import java.io.PrintStream;
import java.util.Scanner;

public class Main {

	static void exec(Scanner in, PrintStream out) {
		int[][] c = new int[3][3];
		for (int i = 0; i < 3; i += 1) {
			for (int j = 0; j < 3; j += 1) {
				c[i][j] = in.nextInt();
			}
		}
		for (int i = 0; i <= 100; i += 1) {
			int a1 = i;
			int b1 = c[0][0] - a1;
			int b2 = c[0][1] - a1;
			int b3 = c[0][2] - a1;
			int a2 = c[1][0] - b1;
			if (a2 + b2 != c[1][1] || a2 + b3 != c[1][2]) {
				continue;
			}
			int a3 = c[2][0] - b1;
			if (a3 + b2 != c[2][1] || a3 + b3 != c[2][2]) {
				continue;
			}
			out.println("Yes");
			return;
		}
		out.println("No");
	}

	public static void main(String[] args) {
		exec(new Scanner(System.in), System.out);
	}

} import java.io.PrintStream; PrintStream java.io import java.util.Scanner; Scanner java.util public class Main {

	static void exec(Scanner in, PrintStream out) {
		int[][] c = new int[3][3];
		for (int i = 0; i < 3; i += 1) {
			for (int j = 0; j < 3; j += 1) {
				c[i][j] = in.nextInt();
			}
		}
		for (int i = 0; i <= 100; i += 1) {
			int a1 = i;
			int b1 = c[0][0] - a1;
			int b2 = c[0][1] - a1;
			int b3 = c[0][2] - a1;
			int a2 = c[1][0] - b1;
			if (a2 + b2 != c[1][1] || a2 + b3 != c[1][2]) {
				continue;
			}
			int a3 = c[2][0] - b1;
			if (a3 + b2 != c[2][1] || a3 + b3 != c[2][2]) {
				continue;
			}
			out.println("Yes");
			return;
		}
		out.println("No");
	}

	public static void main(String[] args) {
		exec(new Scanner(System.in), System.out);
	}

} Main static void exec(Scanner in, PrintStream out) {
		int[][] c = new int[3][3];
		for (int i = 0; i < 3; i += 1) {
			for (int j = 0; j < 3; j += 1) {
				c[i][j] = in.nextInt();
			}
		}
		for (int i = 0; i <= 100; i += 1) {
			int a1 = i;
			int b1 = c[0][0] - a1;
			int b2 = c[0][1] - a1;
			int b3 = c[0][2] - a1;
			int a2 = c[1][0] - b1;
			if (a2 + b2 != c[1][1] || a2 + b3 != c[1][2]) {
				continue;
			}
			int a3 = c[2][0] - b1;
			if (a3 + b2 != c[2][1] || a3 + b3 != c[2][2]) {
				continue;
			}
			out.println("Yes");
			return;
		}
		out.println("No");
	} exec {
		int[][] c = new int[3][3];
		for (int i = 0; i < 3; i += 1) {
			for (int j = 0; j < 3; j += 1) {
				c[i][j] = in.nextInt();
			}
		}
		for (int i = 0; i <= 100; i += 1) {
			int a1 = i;
			int b1 = c[0][0] - a1;
			int b2 = c[0][1] - a1;
			int b3 = c[0][2] - a1;
			int a2 = c[1][0] - b1;
			if (a2 + b2 != c[1][1] || a2 + b3 != c[1][2]) {
				continue;
			}
			int a3 = c[2][0] - b1;
			if (a3 + b2 != c[2][1] || a3 + b3 != c[2][2]) {
				continue;
			}
			out.println("Yes");
			return;
		}
		out.println("No");
	} int[][] c = new int[3][3]; c new int[3][3] 3 3 for (int i = 0; i < 3; i += 1) {
			for (int j = 0; j < 3; j += 1) {
				c[i][j] = in.nextInt();
			}
		} int i = 0; int i = 0; i 0 i < 3 i 3 i += 1 i += 1 i 1 {
			for (int j = 0; j < 3; j += 1) {
				c[i][j] = in.nextInt();
			}
		} {
			for (int j = 0; j < 3; j += 1) {
				c[i][j] = in.nextInt();
			}
		} for (int j = 0; j < 3; j += 1) {
				c[i][j] = in.nextInt();
			} int j = 0; int j = 0; j 0 j < 3 j 3 j += 1 j += 1 j 1 {
				c[i][j] = in.nextInt();
			} {
				c[i][j] = in.nextInt();
			} c[i][j] = in.nextInt() c[i][j] c[i] c i j in.nextInt() in.nextInt in for (int i = 0; i <= 100; i += 1) {
			int a1 = i;
			int b1 = c[0][0] - a1;
			int b2 = c[0][1] - a1;
			int b3 = c[0][2] - a1;
			int a2 = c[1][0] - b1;
			if (a2 + b2 != c[1][1] || a2 + b3 != c[1][2]) {
				continue;
			}
			int a3 = c[2][0] - b1;
			if (a3 + b2 != c[2][1] || a3 + b3 != c[2][2]) {
				continue;
			}
			out.println("Yes");
			return;
		} int i = 0; int i = 0; i 0 i <= 100 i 100 i += 1 i += 1 i 1 {
			int a1 = i;
			int b1 = c[0][0] - a1;
			int b2 = c[0][1] - a1;
			int b3 = c[0][2] - a1;
			int a2 = c[1][0] - b1;
			if (a2 + b2 != c[1][1] || a2 + b3 != c[1][2]) {
				continue;
			}
			int a3 = c[2][0] - b1;
			if (a3 + b2 != c[2][1] || a3 + b3 != c[2][2]) {
				continue;
			}
			out.println("Yes");
			return;
		} {
			int a1 = i;
			int b1 = c[0][0] - a1;
			int b2 = c[0][1] - a1;
			int b3 = c[0][2] - a1;
			int a2 = c[1][0] - b1;
			if (a2 + b2 != c[1][1] || a2 + b3 != c[1][2]) {
				continue;
			}
			int a3 = c[2][0] - b1;
			if (a3 + b2 != c[2][1] || a3 + b3 != c[2][2]) {
				continue;
			}
			out.println("Yes");
			return;
		} int a1 = i; a1 i int b1 = c[0][0] - a1; b1 c[0][0] - a1 c[0][0] c[0] c 0 0 a1 int b2 = c[0][1] - a1; b2 c[0][1] - a1 c[0][1] c[0] c 0 1 a1 int b3 = c[0][2] - a1; b3 c[0][2] - a1 c[0][2] c[0] c 0 2 a1 int a2 = c[1][0] - b1; a2 c[1][0] - b1 c[1][0] c[1] c 1 0 b1 if (a2 + b2 != c[1][1] || a2 + b3 != c[1][2]) {
				continue;
			} a2 + b2 != c[1][1] || a2 + b3 != c[1][2] a2 + b2 != c[1][1] a2 + b2 a2 b2 c[1][1] c[1] c 1 1 a2 + b3 != c[1][2] a2 + b3 a2 b3 c[1][2] c[1] c 1 2 {
				continue;
			} continue; int a3 = c[2][0] - b1; a3 c[2][0] - b1 c[2][0] c[2] c 2 0 b1 if (a3 + b2 != c[2][1] || a3 + b3 != c[2][2]) {
				continue;
			} a3 + b2 != c[2][1] || a3 + b3 != c[2][2] a3 + b2 != c[2][1] a3 + b2 a3 b2 c[2][1] c[2] c 2 1 a3 + b3 != c[2][2] a3 + b3 a3 b3 c[2][2] c[2] c 2 2 {
				continue;
			} continue; out.println("Yes") out.println out "Yes" return; out.println("No") out.println out "No" Scanner in in PrintStream out out public static void main(String[] args) {
		exec(new Scanner(System.in), System.out);
	} main {
		exec(new Scanner(System.in), System.out);
	} exec(new Scanner(System.in), System.out) exec new Scanner(System.in) System.out System System.out String[] args args public class Main {

	static void exec(Scanner in, PrintStream out) {
		int[][] c = new int[3][3];
		for (int i = 0; i < 3; i += 1) {
			for (int j = 0; j < 3; j += 1) {
				c[i][j] = in.nextInt();
			}
		}
		for (int i = 0; i <= 100; i += 1) {
			int a1 = i;
			int b1 = c[0][0] - a1;
			int b2 = c[0][1] - a1;
			int b3 = c[0][2] - a1;
			int a2 = c[1][0] - b1;
			if (a2 + b2 != c[1][1] || a2 + b3 != c[1][2]) {
				continue;
			}
			int a3 = c[2][0] - b1;
			if (a3 + b2 != c[2][1] || a3 + b3 != c[2][2]) {
				continue;
			}
			out.println("Yes");
			return;
		}
		out.println("No");
	}

	public static void main(String[] args) {
		exec(new Scanner(System.in), System.out);
	}

} public class Main {

	static void exec(Scanner in, PrintStream out) {
		int[][] c = new int[3][3];
		for (int i = 0; i < 3; i += 1) {
			for (int j = 0; j < 3; j += 1) {
				c[i][j] = in.nextInt();
			}
		}
		for (int i = 0; i <= 100; i += 1) {
			int a1 = i;
			int b1 = c[0][0] - a1;
			int b2 = c[0][1] - a1;
			int b3 = c[0][2] - a1;
			int a2 = c[1][0] - b1;
			if (a2 + b2 != c[1][1] || a2 + b3 != c[1][2]) {
				continue;
			}
			int a3 = c[2][0] - b1;
			if (a3 + b2 != c[2][1] || a3 + b3 != c[2][2]) {
				continue;
			}
			out.println("Yes");
			return;
		}
		out.println("No");
	}

	public static void main(String[] args) {
		exec(new Scanner(System.in), System.out);
	}

} Main
import java.io.PrintStream;
import java.util.Scanner;

public class Main {

	static void exec(Scanner in, PrintStream out) {
		int[][] c = new int[3][3];
		for (int i = 0; i < 3; i += 1) {
			for (int j = 0; j < 3; j += 1) {
				c[i][j] = in.nextInt();
			}
		}
		for (int i = 0; i <= 100; i += 1) {
			int a1 = i;
			int b1 = c[0][0] - a1;
			int b2 = c[0][1] - a1;
			int b3 = c[0][2] - a1;
			int a2 = c[1][0] - b1;
			if (a2 + b2 != c[1][1] || a2 + b3 != c[1][2]) {
				continue;
			}
			int a3 = c[2][0] - b1;
			if (a3 + b2 != c[2][1] || a3 + b3 != c[2][2]) {
				continue;
			}
			out.println("Yes");
			return;
		}
		out.println("No");
	}

	public static void main(String[] args) {
		exec(new Scanner(System.in), System.out);
	}

}
