
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String[] c1 = sc.nextLine().split(" ");
		String[] c2 = sc.nextLine().split(" ");
		String[] c3 = sc.nextLine().split(" ");
		int[][] grid = new int[][] { { Integer.valueOf(c1[0]), Integer.valueOf(c2[0]), Integer.valueOf(c3[0]) },
				{ Integer.valueOf(c1[1]), Integer.valueOf(c2[1]), Integer.valueOf(c3[1]) },
				{ Integer.valueOf(c1[2]), Integer.valueOf(c2[2]), Integer.valueOf(c3[2]) } };
		int[] x = new int[3];
		int[] y = new int[3];
		x[0] = 0;
		for (int i = 0; i < 3; i++)
			y[i] = grid[0][i] - x[0];
		for (int i = 0; i < 3; i++)
			x[i] = grid[i][0] - y[0];
		String ans = "Yes";
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (x[i] + y[j] != grid[i][j])
					ans = "No";
			}
		}
		System.out.println(ans);
		sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String[] c1 = sc.nextLine().split(" ");
		String[] c2 = sc.nextLine().split(" ");
		String[] c3 = sc.nextLine().split(" ");
		int[][] grid = new int[][] { { Integer.valueOf(c1[0]), Integer.valueOf(c2[0]), Integer.valueOf(c3[0]) },
				{ Integer.valueOf(c1[1]), Integer.valueOf(c2[1]), Integer.valueOf(c3[1]) },
				{ Integer.valueOf(c1[2]), Integer.valueOf(c2[2]), Integer.valueOf(c3[2]) } };
		int[] x = new int[3];
		int[] y = new int[3];
		x[0] = 0;
		for (int i = 0; i < 3; i++)
			y[i] = grid[0][i] - x[0];
		for (int i = 0; i < 3; i++)
			x[i] = grid[i][0] - y[0];
		String ans = "Yes";
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (x[i] + y[j] != grid[i][j])
					ans = "No";
			}
		}
		System.out.println(ans);
		sc.close();
	}
} Main public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String[] c1 = sc.nextLine().split(" ");
		String[] c2 = sc.nextLine().split(" ");
		String[] c3 = sc.nextLine().split(" ");
		int[][] grid = new int[][] { { Integer.valueOf(c1[0]), Integer.valueOf(c2[0]), Integer.valueOf(c3[0]) },
				{ Integer.valueOf(c1[1]), Integer.valueOf(c2[1]), Integer.valueOf(c3[1]) },
				{ Integer.valueOf(c1[2]), Integer.valueOf(c2[2]), Integer.valueOf(c3[2]) } };
		int[] x = new int[3];
		int[] y = new int[3];
		x[0] = 0;
		for (int i = 0; i < 3; i++)
			y[i] = grid[0][i] - x[0];
		for (int i = 0; i < 3; i++)
			x[i] = grid[i][0] - y[0];
		String ans = "Yes";
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (x[i] + y[j] != grid[i][j])
					ans = "No";
			}
		}
		System.out.println(ans);
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		String[] c1 = sc.nextLine().split(" ");
		String[] c2 = sc.nextLine().split(" ");
		String[] c3 = sc.nextLine().split(" ");
		int[][] grid = new int[][] { { Integer.valueOf(c1[0]), Integer.valueOf(c2[0]), Integer.valueOf(c3[0]) },
				{ Integer.valueOf(c1[1]), Integer.valueOf(c2[1]), Integer.valueOf(c3[1]) },
				{ Integer.valueOf(c1[2]), Integer.valueOf(c2[2]), Integer.valueOf(c3[2]) } };
		int[] x = new int[3];
		int[] y = new int[3];
		x[0] = 0;
		for (int i = 0; i < 3; i++)
			y[i] = grid[0][i] - x[0];
		for (int i = 0; i < 3; i++)
			x[i] = grid[i][0] - y[0];
		String ans = "Yes";
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (x[i] + y[j] != grid[i][j])
					ans = "No";
			}
		}
		System.out.println(ans);
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String[] c1 = sc.nextLine().split(" "); c1 sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " String[] c2 = sc.nextLine().split(" "); c2 sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " String[] c3 = sc.nextLine().split(" "); c3 sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " int[][] grid = new int[][] { { Integer.valueOf(c1[0]), Integer.valueOf(c2[0]), Integer.valueOf(c3[0]) },
				{ Integer.valueOf(c1[1]), Integer.valueOf(c2[1]), Integer.valueOf(c3[1]) },
				{ Integer.valueOf(c1[2]), Integer.valueOf(c2[2]), Integer.valueOf(c3[2]) } }; grid new int[][] { { Integer.valueOf(c1[0]), Integer.valueOf(c2[0]), Integer.valueOf(c3[0]) },
				{ Integer.valueOf(c1[1]), Integer.valueOf(c2[1]), Integer.valueOf(c3[1]) },
				{ Integer.valueOf(c1[2]), Integer.valueOf(c2[2]), Integer.valueOf(c3[2]) } } int[] x = new int[3]; x new int[3] 3 int[] y = new int[3]; y new int[3] 3 x[0] = 0 x[0] x 0 0 for (int i = 0; i < 3; i++)
			y[i] = grid[0][i] - x[0]; int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i y[i] = grid[0][i] - x[0]; y[i] = grid[0][i] - x[0] y[i] y i grid[0][i] - x[0] grid[0][i] grid[0] grid 0 i x[0] x 0 for (int i = 0; i < 3; i++)
			x[i] = grid[i][0] - y[0]; int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i x[i] = grid[i][0] - y[0]; x[i] = grid[i][0] - y[0] x[i] x i grid[i][0] - y[0] grid[i][0] grid[i] grid i 0 y[0] y 0 String ans = "Yes"; ans "Yes" for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (x[i] + y[j] != grid[i][j])
					ans = "No";
			}
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			for (int j = 0; j < 3; j++) {
				if (x[i] + y[j] != grid[i][j])
					ans = "No";
			}
		} {
			for (int j = 0; j < 3; j++) {
				if (x[i] + y[j] != grid[i][j])
					ans = "No";
			}
		} for (int j = 0; j < 3; j++) {
				if (x[i] + y[j] != grid[i][j])
					ans = "No";
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				if (x[i] + y[j] != grid[i][j])
					ans = "No";
			} {
				if (x[i] + y[j] != grid[i][j])
					ans = "No";
			} if (x[i] + y[j] != grid[i][j])
					ans = "No"; x[i] + y[j] != grid[i][j] x[i] + y[j] x[i] x i y[j] y j grid[i][j] grid[i] grid i j ans = "No" ans "No" System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String[] c1 = sc.nextLine().split(" ");
		String[] c2 = sc.nextLine().split(" ");
		String[] c3 = sc.nextLine().split(" ");
		int[][] grid = new int[][] { { Integer.valueOf(c1[0]), Integer.valueOf(c2[0]), Integer.valueOf(c3[0]) },
				{ Integer.valueOf(c1[1]), Integer.valueOf(c2[1]), Integer.valueOf(c3[1]) },
				{ Integer.valueOf(c1[2]), Integer.valueOf(c2[2]), Integer.valueOf(c3[2]) } };
		int[] x = new int[3];
		int[] y = new int[3];
		x[0] = 0;
		for (int i = 0; i < 3; i++)
			y[i] = grid[0][i] - x[0];
		for (int i = 0; i < 3; i++)
			x[i] = grid[i][0] - y[0];
		String ans = "Yes";
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (x[i] + y[j] != grid[i][j])
					ans = "No";
			}
		}
		System.out.println(ans);
		sc.close();
	}
} public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String[] c1 = sc.nextLine().split(" ");
		String[] c2 = sc.nextLine().split(" ");
		String[] c3 = sc.nextLine().split(" ");
		int[][] grid = new int[][] { { Integer.valueOf(c1[0]), Integer.valueOf(c2[0]), Integer.valueOf(c3[0]) },
				{ Integer.valueOf(c1[1]), Integer.valueOf(c2[1]), Integer.valueOf(c3[1]) },
				{ Integer.valueOf(c1[2]), Integer.valueOf(c2[2]), Integer.valueOf(c3[2]) } };
		int[] x = new int[3];
		int[] y = new int[3];
		x[0] = 0;
		for (int i = 0; i < 3; i++)
			y[i] = grid[0][i] - x[0];
		for (int i = 0; i < 3; i++)
			x[i] = grid[i][0] - y[0];
		String ans = "Yes";
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (x[i] + y[j] != grid[i][j])
					ans = "No";
			}
		}
		System.out.println(ans);
		sc.close();
	}
} Main

import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String[] c1 = sc.nextLine().split(" ");
		String[] c2 = sc.nextLine().split(" ");
		String[] c3 = sc.nextLine().split(" ");
		int[][] grid = new int[][] { { Integer.valueOf(c1[0]), Integer.valueOf(c2[0]), Integer.valueOf(c3[0]) },
				{ Integer.valueOf(c1[1]), Integer.valueOf(c2[1]), Integer.valueOf(c3[1]) },
				{ Integer.valueOf(c1[2]), Integer.valueOf(c2[2]), Integer.valueOf(c3[2]) } };
		int[] x = new int[3];
		int[] y = new int[3];
		x[0] = 0;
		for (int i = 0; i < 3; i++)
			y[i] = grid[0][i] - x[0];
		for (int i = 0; i < 3; i++)
			x[i] = grid[i][0] - y[0];
		String ans = "Yes";
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (x[i] + y[j] != grid[i][j])
					ans = "No";
			}
		}
		System.out.println(ans);
		sc.close();
	}
}