import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[][] c = new int[3][3];

		for (int i = 0; i < c.length; i++) {
			for (int j = 0; j < c[i].length; j++) {
				c[i][j] = sc.nextInt();
			}
		}

		int[] a = new int[3];
		int[] b = new int[3];

		for (int i = 0; i < b.length; i++) {
			b[i] = c[0][i];
		}

		for (int i = 1; i < a.length; i++) {
			a[i] = c[i][0] - b[0];
		}

		boolean jdg = true;
		outer:
		for (int i = 0; i < c.length; i++) {
			for (int j = 0; j < c[i].length; j++) {
				if (!(jdg = (a[i] + b[j] == c[i][j])))
					break outer;
			}
		}

		System.out.println(jdg ? "Yes" : "No");

		sc.close();
	}
} import java.util.Scanner; Scanner java.util class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[][] c = new int[3][3];

		for (int i = 0; i < c.length; i++) {
			for (int j = 0; j < c[i].length; j++) {
				c[i][j] = sc.nextInt();
			}
		}

		int[] a = new int[3];
		int[] b = new int[3];

		for (int i = 0; i < b.length; i++) {
			b[i] = c[0][i];
		}

		for (int i = 1; i < a.length; i++) {
			a[i] = c[i][0] - b[0];
		}

		boolean jdg = true;
		outer:
		for (int i = 0; i < c.length; i++) {
			for (int j = 0; j < c[i].length; j++) {
				if (!(jdg = (a[i] + b[j] == c[i][j])))
					break outer;
			}
		}

		System.out.println(jdg ? "Yes" : "No");

		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[][] c = new int[3][3];

		for (int i = 0; i < c.length; i++) {
			for (int j = 0; j < c[i].length; j++) {
				c[i][j] = sc.nextInt();
			}
		}

		int[] a = new int[3];
		int[] b = new int[3];

		for (int i = 0; i < b.length; i++) {
			b[i] = c[0][i];
		}

		for (int i = 1; i < a.length; i++) {
			a[i] = c[i][0] - b[0];
		}

		boolean jdg = true;
		outer:
		for (int i = 0; i < c.length; i++) {
			for (int j = 0; j < c[i].length; j++) {
				if (!(jdg = (a[i] + b[j] == c[i][j])))
					break outer;
			}
		}

		System.out.println(jdg ? "Yes" : "No");

		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int[][] c = new int[3][3];

		for (int i = 0; i < c.length; i++) {
			for (int j = 0; j < c[i].length; j++) {
				c[i][j] = sc.nextInt();
			}
		}

		int[] a = new int[3];
		int[] b = new int[3];

		for (int i = 0; i < b.length; i++) {
			b[i] = c[0][i];
		}

		for (int i = 1; i < a.length; i++) {
			a[i] = c[i][0] - b[0];
		}

		boolean jdg = true;
		outer:
		for (int i = 0; i < c.length; i++) {
			for (int j = 0; j < c[i].length; j++) {
				if (!(jdg = (a[i] + b[j] == c[i][j])))
					break outer;
			}
		}

		System.out.println(jdg ? "Yes" : "No");

		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[][] c = new int[3][3]; c new int[3][3] 3 3 for (int i = 0; i < c.length; i++) {
			for (int j = 0; j < c[i].length; j++) {
				c[i][j] = sc.nextInt();
			}
		} int i = 0; int i = 0; i 0 i < c.length i c.length c c.length i++ i++ i {
			for (int j = 0; j < c[i].length; j++) {
				c[i][j] = sc.nextInt();
			}
		} {
			for (int j = 0; j < c[i].length; j++) {
				c[i][j] = sc.nextInt();
			}
		} for (int j = 0; j < c[i].length; j++) {
				c[i][j] = sc.nextInt();
			} int j = 0; int j = 0; j 0 j < c[i].length j c[i].length c[i] c i c[i].length j++ j++ j {
				c[i][j] = sc.nextInt();
			} {
				c[i][j] = sc.nextInt();
			} c[i][j] = sc.nextInt() c[i][j] c[i] c i j sc.nextInt() sc.nextInt sc int[] a = new int[3]; a new int[3] 3 int[] b = new int[3]; b new int[3] 3 for (int i = 0; i < b.length; i++) {
			b[i] = c[0][i];
		} int i = 0; int i = 0; i 0 i < b.length i b.length b b.length i++ i++ i {
			b[i] = c[0][i];
		} {
			b[i] = c[0][i];
		} b[i] = c[0][i] b[i] b i c[0][i] c[0] c 0 i for (int i = 1; i < a.length; i++) {
			a[i] = c[i][0] - b[0];
		} int i = 1; int i = 1; i 1 i < a.length i a.length a a.length i++ i++ i {
			a[i] = c[i][0] - b[0];
		} {
			a[i] = c[i][0] - b[0];
		} a[i] = c[i][0] - b[0] a[i] a i c[i][0] - b[0] c[i][0] c[i] c i 0 b[0] b 0 boolean jdg = true; jdg true System.out.println(jdg ? "Yes" : "No") System.out.println System.out System System.out jdg ? "Yes" : "No" jdg "Yes" "No" sc.close() sc.close sc String[] args args
import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[][] c = new int[3][3];

		for (int i = 0; i < c.length; i++) {
			for (int j = 0; j < c[i].length; j++) {
				c[i][j] = sc.nextInt();
			}
		}

		int[] a = new int[3];
		int[] b = new int[3];

		for (int i = 0; i < b.length; i++) {
			b[i] = c[0][i];
		}

		for (int i = 1; i < a.length; i++) {
			a[i] = c[i][0] - b[0];
		}

		boolean jdg = true;
		outer:
		for (int i = 0; i < c.length; i++) {
			for (int j = 0; j < c[i].length; j++) {
				if (!(jdg = (a[i] + b[j] == c[i][j])))
					break outer;
			}
		}

		System.out.println(jdg ? "Yes" : "No");

		sc.close();
	}
}
