import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner stdin = new Scanner(System.in);

		int[][] c = new int[3][];
		for (int i = 0; i < 3; i++) {
			c[i] = new int[3];
			for (int j = 0; j < 3; j++) {
				c[i][j] = stdin.nextInt();
			}
		}

		String result = "No";
		int a2 = c[1][0] - c[0][0];
		int a3 = c[2][0] - c[0][0];
		if ((c[1][1] == (a2 + c[0][1]))
			&& (c[1][2] == (a2 + c[0][2])) && (c[2][1] == (a3 + c[0][1])) && (c[2][2] == (a3 + c[0][2]))) {
			result = "Yes";
		}

		System.out.println(result);
	}

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

	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner stdin = new Scanner(System.in);

		int[][] c = new int[3][];
		for (int i = 0; i < 3; i++) {
			c[i] = new int[3];
			for (int j = 0; j < 3; j++) {
				c[i][j] = stdin.nextInt();
			}
		}

		String result = "No";
		int a2 = c[1][0] - c[0][0];
		int a3 = c[2][0] - c[0][0];
		if ((c[1][1] == (a2 + c[0][1]))
			&& (c[1][2] == (a2 + c[0][2])) && (c[2][1] == (a3 + c[0][1])) && (c[2][2] == (a3 + c[0][2]))) {
			result = "Yes";
		}

		System.out.println(result);
	}

} Main public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner stdin = new Scanner(System.in);

		int[][] c = new int[3][];
		for (int i = 0; i < 3; i++) {
			c[i] = new int[3];
			for (int j = 0; j < 3; j++) {
				c[i][j] = stdin.nextInt();
			}
		}

		String result = "No";
		int a2 = c[1][0] - c[0][0];
		int a3 = c[2][0] - c[0][0];
		if ((c[1][1] == (a2 + c[0][1]))
			&& (c[1][2] == (a2 + c[0][2])) && (c[2][1] == (a3 + c[0][1])) && (c[2][2] == (a3 + c[0][2]))) {
			result = "Yes";
		}

		System.out.println(result);
	} main {
		@SuppressWarnings("resource")
		Scanner stdin = new Scanner(System.in);

		int[][] c = new int[3][];
		for (int i = 0; i < 3; i++) {
			c[i] = new int[3];
			for (int j = 0; j < 3; j++) {
				c[i][j] = stdin.nextInt();
			}
		}

		String result = "No";
		int a2 = c[1][0] - c[0][0];
		int a3 = c[2][0] - c[0][0];
		if ((c[1][1] == (a2 + c[0][1]))
			&& (c[1][2] == (a2 + c[0][2])) && (c[2][1] == (a3 + c[0][1])) && (c[2][2] == (a3 + c[0][2]))) {
			result = "Yes";
		}

		System.out.println(result);
	} @SuppressWarnings("resource")
		Scanner stdin = new Scanner(System.in); stdin new Scanner(System.in) int[][] c = new int[3][]; c new int[3][] 3 for (int i = 0; i < 3; i++) {
			c[i] = new int[3];
			for (int j = 0; j < 3; j++) {
				c[i][j] = stdin.nextInt();
			}
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			c[i] = new int[3];
			for (int j = 0; j < 3; j++) {
				c[i][j] = stdin.nextInt();
			}
		} {
			c[i] = new int[3];
			for (int j = 0; j < 3; j++) {
				c[i][j] = stdin.nextInt();
			}
		} c[i] = new int[3] c[i] c i new int[3] 3 for (int j = 0; j < 3; j++) {
				c[i][j] = stdin.nextInt();
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				c[i][j] = stdin.nextInt();
			} {
				c[i][j] = stdin.nextInt();
			} c[i][j] = stdin.nextInt() c[i][j] c[i] c i j stdin.nextInt() stdin.nextInt stdin String result = "No"; result "No" int a2 = c[1][0] - c[0][0]; a2 c[1][0] - c[0][0] c[1][0] c[1] c 1 0 c[0][0] c[0] c 0 0 int a3 = c[2][0] - c[0][0]; a3 c[2][0] - c[0][0] c[2][0] c[2] c 2 0 c[0][0] c[0] c 0 0 if ((c[1][1] == (a2 + c[0][1]))
			&& (c[1][2] == (a2 + c[0][2])) && (c[2][1] == (a3 + c[0][1])) && (c[2][2] == (a3 + c[0][2]))) {
			result = "Yes";
		} (c[1][1] == (a2 + c[0][1]))
			&& (c[1][2] == (a2 + c[0][2])) && (c[2][1] == (a3 + c[0][1])) && (c[2][2] == (a3 + c[0][2])) (c[2][1] == (a3 + c[0][1])) (c[1][1] == (a2 + c[0][1]))
			&& (c[1][2] == (a2 + c[0][2])) && (c[2][1] == (a3 + c[0][1])) && (c[2][2] == (a3 + c[0][2])) (c[1][1] == (a2 + c[0][1])) c[1][1] c[1] c 1 1 (a2 + c[0][1]) a2 c[0][1] c[0] c 0 1 (c[1][2] == (a2 + c[0][2])) c[1][2] c[1] c 1 2 (a2 + c[0][2]) a2 c[0][2] c[0] c 0 2 (c[2][1] == (a3 + c[0][1])) c[2][1] c[2] c 2 1 (a3 + c[0][1]) a3 c[0][1] c[0] c 0 1 (c[2][2] == (a3 + c[0][2])) c[2][2] c[2] c 2 2 (a3 + c[0][2]) a3 c[0][2] c[0] c 0 2 {
			result = "Yes";
		} result = "Yes" result "Yes" System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {

	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner stdin = new Scanner(System.in);

		int[][] c = new int[3][];
		for (int i = 0; i < 3; i++) {
			c[i] = new int[3];
			for (int j = 0; j < 3; j++) {
				c[i][j] = stdin.nextInt();
			}
		}

		String result = "No";
		int a2 = c[1][0] - c[0][0];
		int a3 = c[2][0] - c[0][0];
		if ((c[1][1] == (a2 + c[0][1]))
			&& (c[1][2] == (a2 + c[0][2])) && (c[2][1] == (a3 + c[0][1])) && (c[2][2] == (a3 + c[0][2]))) {
			result = "Yes";
		}

		System.out.println(result);
	}

} public class Main {

	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner stdin = new Scanner(System.in);

		int[][] c = new int[3][];
		for (int i = 0; i < 3; i++) {
			c[i] = new int[3];
			for (int j = 0; j < 3; j++) {
				c[i][j] = stdin.nextInt();
			}
		}

		String result = "No";
		int a2 = c[1][0] - c[0][0];
		int a3 = c[2][0] - c[0][0];
		if ((c[1][1] == (a2 + c[0][1]))
			&& (c[1][2] == (a2 + c[0][2])) && (c[2][1] == (a3 + c[0][1])) && (c[2][2] == (a3 + c[0][2]))) {
			result = "Yes";
		}

		System.out.println(result);
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner stdin = new Scanner(System.in);

		int[][] c = new int[3][];
		for (int i = 0; i < 3; i++) {
			c[i] = new int[3];
			for (int j = 0; j < 3; j++) {
				c[i][j] = stdin.nextInt();
			}
		}

		String result = "No";
		int a2 = c[1][0] - c[0][0];
		int a3 = c[2][0] - c[0][0];
		if ((c[1][1] == (a2 + c[0][1]))
			&& (c[1][2] == (a2 + c[0][2])) && (c[2][1] == (a3 + c[0][1])) && (c[2][2] == (a3 + c[0][2]))) {
			result = "Yes";
		}

		System.out.println(result);
	}

}
