
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

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


		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				array[i][j] = scan.nextInt();
			}
		}

		a[0] = 0;
		
		b[0] = array[0][0] - a[0];
		b[1] = array[0][1] - a[0];
		b[2] = array[0][2] - a[0];

		a[1] = array[1][0] - b[0];
		a[2] = array[2][0] - b[0];
		
		/*System.out.println(a[0]);
		System.out.println(a[1]);
		System.out.println(a[2]);
		System.out.println(b[0]);
		System.out.println(b[1]);
		System.out.println(b[2]);
*/
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if(array[i][j] != a[i]+b[j]) {
					System.out.println("No");
					System.exit(0);
				}
			}
		}
		System.out.println("Yes");
		
		/*
		  for(int i = 0; i<3;i++) { for (int j = 0; j <3; j++) {
		  System.out.print(array[i][j]); } System.out.println(""); }
		*/
	}

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

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

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


		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				array[i][j] = scan.nextInt();
			}
		}

		a[0] = 0;
		
		b[0] = array[0][0] - a[0];
		b[1] = array[0][1] - a[0];
		b[2] = array[0][2] - a[0];

		a[1] = array[1][0] - b[0];
		a[2] = array[2][0] - b[0];
		
		/*System.out.println(a[0]);
		System.out.println(a[1]);
		System.out.println(a[2]);
		System.out.println(b[0]);
		System.out.println(b[1]);
		System.out.println(b[2]);
*/
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if(array[i][j] != a[i]+b[j]) {
					System.out.println("No");
					System.exit(0);
				}
			}
		}
		System.out.println("Yes");
		
		/*
		  for(int i = 0; i<3;i++) { for (int j = 0; j <3; j++) {
		  System.out.print(array[i][j]); } System.out.println(""); }
		*/
	}

} Main public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

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


		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				array[i][j] = scan.nextInt();
			}
		}

		a[0] = 0;
		
		b[0] = array[0][0] - a[0];
		b[1] = array[0][1] - a[0];
		b[2] = array[0][2] - a[0];

		a[1] = array[1][0] - b[0];
		a[2] = array[2][0] - b[0];
		
		/*System.out.println(a[0]);
		System.out.println(a[1]);
		System.out.println(a[2]);
		System.out.println(b[0]);
		System.out.println(b[1]);
		System.out.println(b[2]);
*/
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if(array[i][j] != a[i]+b[j]) {
					System.out.println("No");
					System.exit(0);
				}
			}
		}
		System.out.println("Yes");
		
		/*
		  for(int i = 0; i<3;i++) { for (int j = 0; j <3; j++) {
		  System.out.print(array[i][j]); } System.out.println(""); }
		*/
	} main {

		Scanner scan = new Scanner(System.in);

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


		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				array[i][j] = scan.nextInt();
			}
		}

		a[0] = 0;
		
		b[0] = array[0][0] - a[0];
		b[1] = array[0][1] - a[0];
		b[2] = array[0][2] - a[0];

		a[1] = array[1][0] - b[0];
		a[2] = array[2][0] - b[0];
		
		/*System.out.println(a[0]);
		System.out.println(a[1]);
		System.out.println(a[2]);
		System.out.println(b[0]);
		System.out.println(b[1]);
		System.out.println(b[2]);
*/
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if(array[i][j] != a[i]+b[j]) {
					System.out.println("No");
					System.exit(0);
				}
			}
		}
		System.out.println("Yes");
		
		/*
		  for(int i = 0; i<3;i++) { for (int j = 0; j <3; j++) {
		  System.out.print(array[i][j]); } System.out.println(""); }
		*/
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int array[][] = new int[3][3]; array new int[3][3] 3 3 int a[] = new int[3]; a new int[3] 3 int b[] = new int[3]; b new int[3] 3 int c[][] = new int[3][3]; c new int[3][3] 3 3 for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				array[i][j] = scan.nextInt();
			}
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			for (int j = 0; j < 3; j++) {
				array[i][j] = scan.nextInt();
			}
		} {
			for (int j = 0; j < 3; j++) {
				array[i][j] = scan.nextInt();
			}
		} for (int j = 0; j < 3; j++) {
				array[i][j] = scan.nextInt();
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				array[i][j] = scan.nextInt();
			} {
				array[i][j] = scan.nextInt();
			} array[i][j] = scan.nextInt() array[i][j] array[i] array i j scan.nextInt() scan.nextInt scan a[0] = 0 a[0] a 0 0 b[0] = array[0][0] - a[0] b[0] b 0 array[0][0] - a[0] array[0][0] array[0] array 0 0 a[0] a 0 b[1] = array[0][1] - a[0] b[1] b 1 array[0][1] - a[0] array[0][1] array[0] array 0 1 a[0] a 0 b[2] = array[0][2] - a[0] b[2] b 2 array[0][2] - a[0] array[0][2] array[0] array 0 2 a[0] a 0 a[1] = array[1][0] - b[0] a[1] a 1 array[1][0] - b[0] array[1][0] array[1] array 1 0 b[0] b 0 a[2] = array[2][0] - b[0] a[2] a 2 array[2][0] - b[0] array[2][0] array[2] array 2 0 b[0] b 0 for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if(array[i][j] != a[i]+b[j]) {
					System.out.println("No");
					System.exit(0);
				}
			}
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			for (int j = 0; j < 3; j++) {
				if(array[i][j] != a[i]+b[j]) {
					System.out.println("No");
					System.exit(0);
				}
			}
		} {
			for (int j = 0; j < 3; j++) {
				if(array[i][j] != a[i]+b[j]) {
					System.out.println("No");
					System.exit(0);
				}
			}
		} for (int j = 0; j < 3; j++) {
				if(array[i][j] != a[i]+b[j]) {
					System.out.println("No");
					System.exit(0);
				}
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				if(array[i][j] != a[i]+b[j]) {
					System.out.println("No");
					System.exit(0);
				}
			} {
				if(array[i][j] != a[i]+b[j]) {
					System.out.println("No");
					System.exit(0);
				}
			} if(array[i][j] != a[i]+b[j]) {
					System.out.println("No");
					System.exit(0);
				} array[i][j] != a[i]+b[j] array[i][j] array[i] array i j a[i]+b[j] a[i] a i b[j] b j {
					System.out.println("No");
					System.exit(0);
				} System.out.println("No") System.out.println System.out System System.out "No" System.exit(0) System.exit System 0 System.out.println("Yes") System.out.println System.out System System.out "Yes" String[] args args public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

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


		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				array[i][j] = scan.nextInt();
			}
		}

		a[0] = 0;
		
		b[0] = array[0][0] - a[0];
		b[1] = array[0][1] - a[0];
		b[2] = array[0][2] - a[0];

		a[1] = array[1][0] - b[0];
		a[2] = array[2][0] - b[0];
		
		/*System.out.println(a[0]);
		System.out.println(a[1]);
		System.out.println(a[2]);
		System.out.println(b[0]);
		System.out.println(b[1]);
		System.out.println(b[2]);
*/
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if(array[i][j] != a[i]+b[j]) {
					System.out.println("No");
					System.exit(0);
				}
			}
		}
		System.out.println("Yes");
		
		/*
		  for(int i = 0; i<3;i++) { for (int j = 0; j <3; j++) {
		  System.out.print(array[i][j]); } System.out.println(""); }
		*/
	}

} public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

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


		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				array[i][j] = scan.nextInt();
			}
		}

		a[0] = 0;
		
		b[0] = array[0][0] - a[0];
		b[1] = array[0][1] - a[0];
		b[2] = array[0][2] - a[0];

		a[1] = array[1][0] - b[0];
		a[2] = array[2][0] - b[0];
		
		/*System.out.println(a[0]);
		System.out.println(a[1]);
		System.out.println(a[2]);
		System.out.println(b[0]);
		System.out.println(b[1]);
		System.out.println(b[2]);
*/
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if(array[i][j] != a[i]+b[j]) {
					System.out.println("No");
					System.exit(0);
				}
			}
		}
		System.out.println("Yes");
		
		/*
		  for(int i = 0; i<3;i++) { for (int j = 0; j <3; j++) {
		  System.out.print(array[i][j]); } System.out.println(""); }
		*/
	}

} Main

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

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


		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				array[i][j] = scan.nextInt();
			}
		}

		a[0] = 0;
		
		b[0] = array[0][0] - a[0];
		b[1] = array[0][1] - a[0];
		b[2] = array[0][2] - a[0];

		a[1] = array[1][0] - b[0];
		a[2] = array[2][0] - b[0];
		
		/*System.out.println(a[0]);
		System.out.println(a[1]);
		System.out.println(a[2]);
		System.out.println(b[0]);
		System.out.println(b[1]);
		System.out.println(b[2]);
*/
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if(array[i][j] != a[i]+b[j]) {
					System.out.println("No");
					System.exit(0);
				}
			}
		}
		System.out.println("Yes");
		
		/*
		  for(int i = 0; i<3;i++) { for (int j = 0; j <3; j++) {
		  System.out.print(array[i][j]); } System.out.println(""); }
		*/
	}

}
