import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a1, a2, a3, b1, b2, b3;
		int[][] grid = new int[3][3];
		for (int i=0; i<3; i++) {
			for (int j=0; j<3; j++) {
				grid[i][j] = sc.nextInt();
			}
		}
		String res = "No";
		for (a1=0; a1<=grid[0][0]; a1++) {
			b1 = grid[0][0] - a1;
			b2 = grid[0][1] - a1;
			b3 = grid[0][2] - a1;
			a2 = grid[1][0] - b1;
			a3 = grid[2][0] - b1;
			if (a2+b2 == grid[1][1]
					&& a2+b3 == grid[1][2]
					&& a3+b2 == grid[2][1]
					&& a3+b3 == grid[2][2]) res = "Yes"; 
		}
		System.out.println(res);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a1, a2, a3, b1, b2, b3;
		int[][] grid = new int[3][3];
		for (int i=0; i<3; i++) {
			for (int j=0; j<3; j++) {
				grid[i][j] = sc.nextInt();
			}
		}
		String res = "No";
		for (a1=0; a1<=grid[0][0]; a1++) {
			b1 = grid[0][0] - a1;
			b2 = grid[0][1] - a1;
			b3 = grid[0][2] - a1;
			a2 = grid[1][0] - b1;
			a3 = grid[2][0] - b1;
			if (a2+b2 == grid[1][1]
					&& a2+b3 == grid[1][2]
					&& a3+b2 == grid[2][1]
					&& a3+b3 == grid[2][2]) res = "Yes"; 
		}
		System.out.println(res);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a1, a2, a3, b1, b2, b3;
		int[][] grid = new int[3][3];
		for (int i=0; i<3; i++) {
			for (int j=0; j<3; j++) {
				grid[i][j] = sc.nextInt();
			}
		}
		String res = "No";
		for (a1=0; a1<=grid[0][0]; a1++) {
			b1 = grid[0][0] - a1;
			b2 = grid[0][1] - a1;
			b3 = grid[0][2] - a1;
			a2 = grid[1][0] - b1;
			a3 = grid[2][0] - b1;
			if (a2+b2 == grid[1][1]
					&& a2+b3 == grid[1][2]
					&& a3+b2 == grid[2][1]
					&& a3+b3 == grid[2][2]) res = "Yes"; 
		}
		System.out.println(res);
	} main {
		Scanner sc = new Scanner(System.in);
		int a1, a2, a3, b1, b2, b3;
		int[][] grid = new int[3][3];
		for (int i=0; i<3; i++) {
			for (int j=0; j<3; j++) {
				grid[i][j] = sc.nextInt();
			}
		}
		String res = "No";
		for (a1=0; a1<=grid[0][0]; a1++) {
			b1 = grid[0][0] - a1;
			b2 = grid[0][1] - a1;
			b3 = grid[0][2] - a1;
			a2 = grid[1][0] - b1;
			a3 = grid[2][0] - b1;
			if (a2+b2 == grid[1][1]
					&& a2+b3 == grid[1][2]
					&& a3+b2 == grid[2][1]
					&& a3+b3 == grid[2][2]) res = "Yes"; 
		}
		System.out.println(res);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a1 a1 a2 a2 a3 a3 b1 b1 b2 b2 b3; b3 int[][] grid = new int[3][3]; grid new int[3][3] 3 3 for (int i=0; i<3; i++) {
			for (int j=0; j<3; j++) {
				grid[i][j] = sc.nextInt();
			}
		} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
			for (int j=0; j<3; j++) {
				grid[i][j] = sc.nextInt();
			}
		} {
			for (int j=0; j<3; j++) {
				grid[i][j] = sc.nextInt();
			}
		} for (int j=0; j<3; j++) {
				grid[i][j] = sc.nextInt();
			} int j=0; int j=0; j 0 j<3 j 3 j++ j++ j {
				grid[i][j] = sc.nextInt();
			} {
				grid[i][j] = sc.nextInt();
			} grid[i][j] = sc.nextInt() grid[i][j] grid[i] grid i j sc.nextInt() sc.nextInt sc String res = "No"; res "No" for (a1=0; a1<=grid[0][0]; a1++) {
			b1 = grid[0][0] - a1;
			b2 = grid[0][1] - a1;
			b3 = grid[0][2] - a1;
			a2 = grid[1][0] - b1;
			a3 = grid[2][0] - b1;
			if (a2+b2 == grid[1][1]
					&& a2+b3 == grid[1][2]
					&& a3+b2 == grid[2][1]
					&& a3+b3 == grid[2][2]) res = "Yes"; 
		} a1=0; a1=0 a1 0 a1<=grid[0][0] a1 grid[0][0] grid[0] grid 0 0 a1++ a1++ a1 {
			b1 = grid[0][0] - a1;
			b2 = grid[0][1] - a1;
			b3 = grid[0][2] - a1;
			a2 = grid[1][0] - b1;
			a3 = grid[2][0] - b1;
			if (a2+b2 == grid[1][1]
					&& a2+b3 == grid[1][2]
					&& a3+b2 == grid[2][1]
					&& a3+b3 == grid[2][2]) res = "Yes"; 
		} {
			b1 = grid[0][0] - a1;
			b2 = grid[0][1] - a1;
			b3 = grid[0][2] - a1;
			a2 = grid[1][0] - b1;
			a3 = grid[2][0] - b1;
			if (a2+b2 == grid[1][1]
					&& a2+b3 == grid[1][2]
					&& a3+b2 == grid[2][1]
					&& a3+b3 == grid[2][2]) res = "Yes"; 
		} b1 = grid[0][0] - a1 b1 grid[0][0] - a1 grid[0][0] grid[0] grid 0 0 a1 b2 = grid[0][1] - a1 b2 grid[0][1] - a1 grid[0][1] grid[0] grid 0 1 a1 b3 = grid[0][2] - a1 b3 grid[0][2] - a1 grid[0][2] grid[0] grid 0 2 a1 a2 = grid[1][0] - b1 a2 grid[1][0] - b1 grid[1][0] grid[1] grid 1 0 b1 a3 = grid[2][0] - b1 a3 grid[2][0] - b1 grid[2][0] grid[2] grid 2 0 b1 if (a2+b2 == grid[1][1]
					&& a2+b3 == grid[1][2]
					&& a3+b2 == grid[2][1]
					&& a3+b3 == grid[2][2]) res = "Yes"; a2+b2 == grid[1][1]
					&& a2+b3 == grid[1][2]
					&& a3+b2 == grid[2][1]
					&& a3+b3 == grid[2][2] a3+b2 == grid[2][1] a2+b2 == grid[1][1]
					&& a2+b3 == grid[1][2]
					&& a3+b2 == grid[2][1]
					&& a3+b3 == grid[2][2] a2+b2 == grid[1][1] a2+b2 a2 b2 grid[1][1] grid[1] grid 1 1 a2+b3 == grid[1][2] a2+b3 a2 b3 grid[1][2] grid[1] grid 1 2 a3+b2 == grid[2][1] a3+b2 a3 b2 grid[2][1] grid[2] grid 2 1 a3+b3 == grid[2][2] a3+b3 a3 b3 grid[2][2] grid[2] grid 2 2 res = "Yes" res "Yes" System.out.println(res) System.out.println System.out System System.out res String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a1, a2, a3, b1, b2, b3;
		int[][] grid = new int[3][3];
		for (int i=0; i<3; i++) {
			for (int j=0; j<3; j++) {
				grid[i][j] = sc.nextInt();
			}
		}
		String res = "No";
		for (a1=0; a1<=grid[0][0]; a1++) {
			b1 = grid[0][0] - a1;
			b2 = grid[0][1] - a1;
			b3 = grid[0][2] - a1;
			a2 = grid[1][0] - b1;
			a3 = grid[2][0] - b1;
			if (a2+b2 == grid[1][1]
					&& a2+b3 == grid[1][2]
					&& a3+b2 == grid[2][1]
					&& a3+b3 == grid[2][2]) res = "Yes"; 
		}
		System.out.println(res);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a1, a2, a3, b1, b2, b3;
		int[][] grid = new int[3][3];
		for (int i=0; i<3; i++) {
			for (int j=0; j<3; j++) {
				grid[i][j] = sc.nextInt();
			}
		}
		String res = "No";
		for (a1=0; a1<=grid[0][0]; a1++) {
			b1 = grid[0][0] - a1;
			b2 = grid[0][1] - a1;
			b3 = grid[0][2] - a1;
			a2 = grid[1][0] - b1;
			a3 = grid[2][0] - b1;
			if (a2+b2 == grid[1][1]
					&& a2+b3 == grid[1][2]
					&& a3+b2 == grid[2][1]
					&& a3+b3 == grid[2][2]) res = "Yes"; 
		}
		System.out.println(res);
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a1, a2, a3, b1, b2, b3;
		int[][] grid = new int[3][3];
		for (int i=0; i<3; i++) {
			for (int j=0; j<3; j++) {
				grid[i][j] = sc.nextInt();
			}
		}
		String res = "No";
		for (a1=0; a1<=grid[0][0]; a1++) {
			b1 = grid[0][0] - a1;
			b2 = grid[0][1] - a1;
			b3 = grid[0][2] - a1;
			a2 = grid[1][0] - b1;
			a3 = grid[2][0] - b1;
			if (a2+b2 == grid[1][1]
					&& a2+b3 == grid[1][2]
					&& a3+b2 == grid[2][1]
					&& a3+b3 == grid[2][2]) res = "Yes"; 
		}
		System.out.println(res);
	}
}
