
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int[][] arr = new int[3][3];
		int[] A = new int[2];
		int[] B = new int[2];
		Arrays.fill(A, 101);
		Arrays.fill(B, 101);
		String ans = "Yes";
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				arr[i][j] = reader.nextInt();
			}
		}
		A[0] = arr[0][0] - arr[1][0];
		A[1] = arr[1][0] - arr[2][0];
		B[0] = arr[0][0] - arr[0][1];
		B[1] = arr[0][1] - arr[0][2];

		for (int i = 1; i < 3; i++) {
			for (int j = 1; j < 3; j++) {
				if (arr[i-1][j] - A[i-1] != arr[i][j] ||
					arr[i][j-1] - B[j-1] != arr[i][j]) {
					ans = "No";
				}
			}

		}

		System.out.print(ans);
		reader.close();
	}
}


 import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int[][] arr = new int[3][3];
		int[] A = new int[2];
		int[] B = new int[2];
		Arrays.fill(A, 101);
		Arrays.fill(B, 101);
		String ans = "Yes";
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				arr[i][j] = reader.nextInt();
			}
		}
		A[0] = arr[0][0] - arr[1][0];
		A[1] = arr[1][0] - arr[2][0];
		B[0] = arr[0][0] - arr[0][1];
		B[1] = arr[0][1] - arr[0][2];

		for (int i = 1; i < 3; i++) {
			for (int j = 1; j < 3; j++) {
				if (arr[i-1][j] - A[i-1] != arr[i][j] ||
					arr[i][j-1] - B[j-1] != arr[i][j]) {
					ans = "No";
				}
			}

		}

		System.out.print(ans);
		reader.close();
	}
} Main public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int[][] arr = new int[3][3];
		int[] A = new int[2];
		int[] B = new int[2];
		Arrays.fill(A, 101);
		Arrays.fill(B, 101);
		String ans = "Yes";
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				arr[i][j] = reader.nextInt();
			}
		}
		A[0] = arr[0][0] - arr[1][0];
		A[1] = arr[1][0] - arr[2][0];
		B[0] = arr[0][0] - arr[0][1];
		B[1] = arr[0][1] - arr[0][2];

		for (int i = 1; i < 3; i++) {
			for (int j = 1; j < 3; j++) {
				if (arr[i-1][j] - A[i-1] != arr[i][j] ||
					arr[i][j-1] - B[j-1] != arr[i][j]) {
					ans = "No";
				}
			}

		}

		System.out.print(ans);
		reader.close();
	} main {
		Scanner reader = new Scanner(System.in);
		int[][] arr = new int[3][3];
		int[] A = new int[2];
		int[] B = new int[2];
		Arrays.fill(A, 101);
		Arrays.fill(B, 101);
		String ans = "Yes";
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				arr[i][j] = reader.nextInt();
			}
		}
		A[0] = arr[0][0] - arr[1][0];
		A[1] = arr[1][0] - arr[2][0];
		B[0] = arr[0][0] - arr[0][1];
		B[1] = arr[0][1] - arr[0][2];

		for (int i = 1; i < 3; i++) {
			for (int j = 1; j < 3; j++) {
				if (arr[i-1][j] - A[i-1] != arr[i][j] ||
					arr[i][j-1] - B[j-1] != arr[i][j]) {
					ans = "No";
				}
			}

		}

		System.out.print(ans);
		reader.close();
	} Scanner reader = new Scanner(System.in); reader new Scanner(System.in) int[][] arr = new int[3][3]; arr new int[3][3] 3 3 int[] A = new int[2]; A new int[2] 2 int[] B = new int[2]; B new int[2] 2 Arrays.fill(A, 101) Arrays.fill Arrays A 101 Arrays.fill(B, 101) Arrays.fill Arrays B 101 String ans = "Yes"; ans "Yes" for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				arr[i][j] = reader.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] = reader.nextInt();
			}
		} {
			for (int j = 0; j < 3; j++) {
				arr[i][j] = reader.nextInt();
			}
		} for (int j = 0; j < 3; j++) {
				arr[i][j] = reader.nextInt();
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				arr[i][j] = reader.nextInt();
			} {
				arr[i][j] = reader.nextInt();
			} arr[i][j] = reader.nextInt() arr[i][j] arr[i] arr i j reader.nextInt() reader.nextInt reader A[0] = arr[0][0] - arr[1][0] A[0] A 0 arr[0][0] - arr[1][0] arr[0][0] arr[0] arr 0 0 arr[1][0] arr[1] arr 1 0 A[1] = arr[1][0] - arr[2][0] A[1] A 1 arr[1][0] - arr[2][0] arr[1][0] arr[1] arr 1 0 arr[2][0] arr[2] arr 2 0 B[0] = arr[0][0] - arr[0][1] B[0] B 0 arr[0][0] - arr[0][1] arr[0][0] arr[0] arr 0 0 arr[0][1] arr[0] arr 0 1 B[1] = arr[0][1] - arr[0][2] B[1] B 1 arr[0][1] - arr[0][2] arr[0][1] arr[0] arr 0 1 arr[0][2] arr[0] arr 0 2 for (int i = 1; i < 3; i++) {
			for (int j = 1; j < 3; j++) {
				if (arr[i-1][j] - A[i-1] != arr[i][j] ||
					arr[i][j-1] - B[j-1] != arr[i][j]) {
					ans = "No";
				}
			}

		} int i = 1; int i = 1; i 1 i < 3 i 3 i++ i++ i {
			for (int j = 1; j < 3; j++) {
				if (arr[i-1][j] - A[i-1] != arr[i][j] ||
					arr[i][j-1] - B[j-1] != arr[i][j]) {
					ans = "No";
				}
			}

		} {
			for (int j = 1; j < 3; j++) {
				if (arr[i-1][j] - A[i-1] != arr[i][j] ||
					arr[i][j-1] - B[j-1] != arr[i][j]) {
					ans = "No";
				}
			}

		} for (int j = 1; j < 3; j++) {
				if (arr[i-1][j] - A[i-1] != arr[i][j] ||
					arr[i][j-1] - B[j-1] != arr[i][j]) {
					ans = "No";
				}
			} int j = 1; int j = 1; j 1 j < 3 j 3 j++ j++ j {
				if (arr[i-1][j] - A[i-1] != arr[i][j] ||
					arr[i][j-1] - B[j-1] != arr[i][j]) {
					ans = "No";
				}
			} {
				if (arr[i-1][j] - A[i-1] != arr[i][j] ||
					arr[i][j-1] - B[j-1] != arr[i][j]) {
					ans = "No";
				}
			} if (arr[i-1][j] - A[i-1] != arr[i][j] ||
					arr[i][j-1] - B[j-1] != arr[i][j]) {
					ans = "No";
				} arr[i-1][j] - A[i-1] != arr[i][j] ||
					arr[i][j-1] - B[j-1] != arr[i][j] arr[i-1][j] - A[i-1] != arr[i][j] arr[i-1][j] - A[i-1] arr[i-1][j] arr[i-1] arr i-1 i 1 j A[i-1] A i-1 i 1 arr[i][j] arr[i] arr i j arr[i][j-1] - B[j-1] != arr[i][j] arr[i][j-1] - B[j-1] arr[i][j-1] arr[i] arr i j-1 j 1 B[j-1] B j-1 j 1 arr[i][j] arr[i] arr i j {
					ans = "No";
				} ans = "No" ans "No" System.out.print(ans) System.out.print System.out System System.out ans reader.close() reader.close reader String[] args args public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int[][] arr = new int[3][3];
		int[] A = new int[2];
		int[] B = new int[2];
		Arrays.fill(A, 101);
		Arrays.fill(B, 101);
		String ans = "Yes";
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				arr[i][j] = reader.nextInt();
			}
		}
		A[0] = arr[0][0] - arr[1][0];
		A[1] = arr[1][0] - arr[2][0];
		B[0] = arr[0][0] - arr[0][1];
		B[1] = arr[0][1] - arr[0][2];

		for (int i = 1; i < 3; i++) {
			for (int j = 1; j < 3; j++) {
				if (arr[i-1][j] - A[i-1] != arr[i][j] ||
					arr[i][j-1] - B[j-1] != arr[i][j]) {
					ans = "No";
				}
			}

		}

		System.out.print(ans);
		reader.close();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int[][] arr = new int[3][3];
		int[] A = new int[2];
		int[] B = new int[2];
		Arrays.fill(A, 101);
		Arrays.fill(B, 101);
		String ans = "Yes";
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				arr[i][j] = reader.nextInt();
			}
		}
		A[0] = arr[0][0] - arr[1][0];
		A[1] = arr[1][0] - arr[2][0];
		B[0] = arr[0][0] - arr[0][1];
		B[1] = arr[0][1] - arr[0][2];

		for (int i = 1; i < 3; i++) {
			for (int j = 1; j < 3; j++) {
				if (arr[i-1][j] - A[i-1] != arr[i][j] ||
					arr[i][j-1] - B[j-1] != arr[i][j]) {
					ans = "No";
				}
			}

		}

		System.out.print(ans);
		reader.close();
	}
} Main

import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int[][] arr = new int[3][3];
		int[] A = new int[2];
		int[] B = new int[2];
		Arrays.fill(A, 101);
		Arrays.fill(B, 101);
		String ans = "Yes";
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				arr[i][j] = reader.nextInt();
			}
		}
		A[0] = arr[0][0] - arr[1][0];
		A[1] = arr[1][0] - arr[2][0];
		B[0] = arr[0][0] - arr[0][1];
		B[1] = arr[0][1] - arr[0][2];

		for (int i = 1; i < 3; i++) {
			for (int j = 1; j < 3; j++) {
				if (arr[i-1][j] - A[i-1] != arr[i][j] ||
					arr[i][j-1] - B[j-1] != arr[i][j]) {
					ans = "No";
				}
			}

		}

		System.out.print(ans);
		reader.close();
	}
}



