

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
			Scanner sc = new Scanner(System.in);
			String result = "Yes";
			int[][] arr = new int[3][3];
			for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 3; j++) {
					arr[i][j] = sc.nextInt();
				}
			}
			int a[] = new int[3];
			int b[] = new int[3];
			a[0] = 0;
			for(int i = 0; i < 3; i++) {
				b[i] = arr[0][i] - a[0];
				a[i] = arr[i][0] - b[0];
			}
			l : for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 3; j++) {
					if(a[i] + b[j] != arr[i][j]) {
						result = "No";
						break l;
					}
				}
			}
			System.out.println(result);
	}

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

	public static void main(String[] args) {
			Scanner sc = new Scanner(System.in);
			String result = "Yes";
			int[][] arr = new int[3][3];
			for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 3; j++) {
					arr[i][j] = sc.nextInt();
				}
			}
			int a[] = new int[3];
			int b[] = new int[3];
			a[0] = 0;
			for(int i = 0; i < 3; i++) {
				b[i] = arr[0][i] - a[0];
				a[i] = arr[i][0] - b[0];
			}
			l : for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 3; j++) {
					if(a[i] + b[j] != arr[i][j]) {
						result = "No";
						break l;
					}
				}
			}
			System.out.println(result);
	}

} Main public static void main(String[] args) {
			Scanner sc = new Scanner(System.in);
			String result = "Yes";
			int[][] arr = new int[3][3];
			for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 3; j++) {
					arr[i][j] = sc.nextInt();
				}
			}
			int a[] = new int[3];
			int b[] = new int[3];
			a[0] = 0;
			for(int i = 0; i < 3; i++) {
				b[i] = arr[0][i] - a[0];
				a[i] = arr[i][0] - b[0];
			}
			l : for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 3; j++) {
					if(a[i] + b[j] != arr[i][j]) {
						result = "No";
						break l;
					}
				}
			}
			System.out.println(result);
	} main {
			Scanner sc = new Scanner(System.in);
			String result = "Yes";
			int[][] arr = new int[3][3];
			for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 3; j++) {
					arr[i][j] = sc.nextInt();
				}
			}
			int a[] = new int[3];
			int b[] = new int[3];
			a[0] = 0;
			for(int i = 0; i < 3; i++) {
				b[i] = arr[0][i] - a[0];
				a[i] = arr[i][0] - b[0];
			}
			l : for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 3; j++) {
					if(a[i] + b[j] != arr[i][j]) {
						result = "No";
						break l;
					}
				}
			}
			System.out.println(result);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String result = "Yes"; result "Yes" int[][] arr = new int[3][3]; arr new int[3][3] 3 3 for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 3; j++) {
					arr[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++) {
					arr[i][j] = sc.nextInt();
				}
			} {
				for(int j = 0; j < 3; j++) {
					arr[i][j] = sc.nextInt();
				}
			} for(int j = 0; j < 3; j++) {
					arr[i][j] = sc.nextInt();
				} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
					arr[i][j] = sc.nextInt();
				} {
					arr[i][j] = sc.nextInt();
				} arr[i][j] = sc.nextInt() arr[i][j] arr[i] arr 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 a[0] = 0 a[0] a 0 0 for(int i = 0; i < 3; i++) {
				b[i] = arr[0][i] - a[0];
				a[i] = arr[i][0] - b[0];
			} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
				b[i] = arr[0][i] - a[0];
				a[i] = arr[i][0] - b[0];
			} {
				b[i] = arr[0][i] - a[0];
				a[i] = arr[i][0] - b[0];
			} b[i] = arr[0][i] - a[0] b[i] b i arr[0][i] - a[0] arr[0][i] arr[0] arr 0 i a[0] a 0 a[i] = arr[i][0] - b[0] a[i] a i arr[i][0] - b[0] arr[i][0] arr[i] arr i 0 b[0] b 0 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) {
			Scanner sc = new Scanner(System.in);
			String result = "Yes";
			int[][] arr = new int[3][3];
			for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 3; j++) {
					arr[i][j] = sc.nextInt();
				}
			}
			int a[] = new int[3];
			int b[] = new int[3];
			a[0] = 0;
			for(int i = 0; i < 3; i++) {
				b[i] = arr[0][i] - a[0];
				a[i] = arr[i][0] - b[0];
			}
			l : for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 3; j++) {
					if(a[i] + b[j] != arr[i][j]) {
						result = "No";
						break l;
					}
				}
			}
			System.out.println(result);
	}

} public class Main {

	public static void main(String[] args) {
			Scanner sc = new Scanner(System.in);
			String result = "Yes";
			int[][] arr = new int[3][3];
			for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 3; j++) {
					arr[i][j] = sc.nextInt();
				}
			}
			int a[] = new int[3];
			int b[] = new int[3];
			a[0] = 0;
			for(int i = 0; i < 3; i++) {
				b[i] = arr[0][i] - a[0];
				a[i] = arr[i][0] - b[0];
			}
			l : for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 3; j++) {
					if(a[i] + b[j] != arr[i][j]) {
						result = "No";
						break l;
					}
				}
			}
			System.out.println(result);
	}

} Main


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
			Scanner sc = new Scanner(System.in);
			String result = "Yes";
			int[][] arr = new int[3][3];
			for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 3; j++) {
					arr[i][j] = sc.nextInt();
				}
			}
			int a[] = new int[3];
			int b[] = new int[3];
			a[0] = 0;
			for(int i = 0; i < 3; i++) {
				b[i] = arr[0][i] - a[0];
				a[i] = arr[i][0] - b[0];
			}
			l : for(int i = 0; i < 3; i++) {
				for(int j = 0; j < 3; j++) {
					if(a[i] + b[j] != arr[i][j]) {
						result = "No";
						break l;
					}
				}
			}
			System.out.println(result);
	}

}
