import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[][] C = new int[3][3];
		for(int i = 0;i < 3;i++) {
			for(int j = 0;j < 3;j++) {
				C[i][j] = Integer.parseInt(sc.next());
			}
		}
		sc.close();
		int[] a = new int[3];
		int[] b = new int[3];
		a[0] = 0;
		b[0] = C[0][0];
		b[1] = C[0][1];
		b[2] = C[0][2];
		a[1] = C[1][0] - b[0];
		a[2] = C[2][0] - b[0];
		String ans = "Yes";
		for(int i = 0;i < 3;i++) {
			for(int j = 0;j < 3;j++) {
				if(a[i] + b[j] != C[i][j]) {
					ans = "No";
				}
			}
		}
		System.out.println(ans);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[][] C = new int[3][3];
		for(int i = 0;i < 3;i++) {
			for(int j = 0;j < 3;j++) {
				C[i][j] = Integer.parseInt(sc.next());
			}
		}
		sc.close();
		int[] a = new int[3];
		int[] b = new int[3];
		a[0] = 0;
		b[0] = C[0][0];
		b[1] = C[0][1];
		b[2] = C[0][2];
		a[1] = C[1][0] - b[0];
		a[2] = C[2][0] - b[0];
		String ans = "Yes";
		for(int i = 0;i < 3;i++) {
			for(int j = 0;j < 3;j++) {
				if(a[i] + b[j] != C[i][j]) {
					ans = "No";
				}
			}
		}
		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[][] C = new int[3][3];
		for(int i = 0;i < 3;i++) {
			for(int j = 0;j < 3;j++) {
				C[i][j] = Integer.parseInt(sc.next());
			}
		}
		sc.close();
		int[] a = new int[3];
		int[] b = new int[3];
		a[0] = 0;
		b[0] = C[0][0];
		b[1] = C[0][1];
		b[2] = C[0][2];
		a[1] = C[1][0] - b[0];
		a[2] = C[2][0] - b[0];
		String ans = "Yes";
		for(int i = 0;i < 3;i++) {
			for(int j = 0;j < 3;j++) {
				if(a[i] + b[j] != C[i][j]) {
					ans = "No";
				}
			}
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int[][] C = new int[3][3];
		for(int i = 0;i < 3;i++) {
			for(int j = 0;j < 3;j++) {
				C[i][j] = Integer.parseInt(sc.next());
			}
		}
		sc.close();
		int[] a = new int[3];
		int[] b = new int[3];
		a[0] = 0;
		b[0] = C[0][0];
		b[1] = C[0][1];
		b[2] = C[0][2];
		a[1] = C[1][0] - b[0];
		a[2] = C[2][0] - b[0];
		String ans = "Yes";
		for(int i = 0;i < 3;i++) {
			for(int j = 0;j < 3;j++) {
				if(a[i] + b[j] != C[i][j]) {
					ans = "No";
				}
			}
		}
		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) 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++) {
				C[i][j] = Integer.parseInt(sc.next());
			}
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			for(int j = 0;j < 3;j++) {
				C[i][j] = Integer.parseInt(sc.next());
			}
		} {
			for(int j = 0;j < 3;j++) {
				C[i][j] = Integer.parseInt(sc.next());
			}
		} for(int j = 0;j < 3;j++) {
				C[i][j] = Integer.parseInt(sc.next());
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				C[i][j] = Integer.parseInt(sc.next());
			} {
				C[i][j] = Integer.parseInt(sc.next());
			} C[i][j] = Integer.parseInt(sc.next()) C[i][j] C[i] C i j Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc sc.close() sc.close 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 b[0] = C[0][0] b[0] b 0 C[0][0] C[0] C 0 0 b[1] = C[0][1] b[1] b 1 C[0][1] C[0] C 0 1 b[2] = C[0][2] b[2] b 2 C[0][2] C[0] C 0 2 a[1] = C[1][0] - b[0] a[1] a 1 C[1][0] - b[0] C[1][0] C[1] C 1 0 b[0] b 0 a[2] = C[2][0] - b[0] a[2] a 2 C[2][0] - b[0] C[2][0] C[2] C 2 0 b[0] b 0 String ans = "Yes"; ans "Yes" for(int i = 0;i < 3;i++) {
			for(int j = 0;j < 3;j++) {
				if(a[i] + b[j] != C[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(a[i] + b[j] != C[i][j]) {
					ans = "No";
				}
			}
		} {
			for(int j = 0;j < 3;j++) {
				if(a[i] + b[j] != C[i][j]) {
					ans = "No";
				}
			}
		} for(int j = 0;j < 3;j++) {
				if(a[i] + b[j] != C[i][j]) {
					ans = "No";
				}
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				if(a[i] + b[j] != C[i][j]) {
					ans = "No";
				}
			} {
				if(a[i] + b[j] != C[i][j]) {
					ans = "No";
				}
			} if(a[i] + b[j] != C[i][j]) {
					ans = "No";
				} a[i] + b[j] != C[i][j] a[i] + b[j] a[i] a i b[j] b j C[i][j] C[i] C i j {
					ans = "No";
				} ans = "No" ans "No" System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[][] C = new int[3][3];
		for(int i = 0;i < 3;i++) {
			for(int j = 0;j < 3;j++) {
				C[i][j] = Integer.parseInt(sc.next());
			}
		}
		sc.close();
		int[] a = new int[3];
		int[] b = new int[3];
		a[0] = 0;
		b[0] = C[0][0];
		b[1] = C[0][1];
		b[2] = C[0][2];
		a[1] = C[1][0] - b[0];
		a[2] = C[2][0] - b[0];
		String ans = "Yes";
		for(int i = 0;i < 3;i++) {
			for(int j = 0;j < 3;j++) {
				if(a[i] + b[j] != C[i][j]) {
					ans = "No";
				}
			}
		}
		System.out.println(ans);
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[][] C = new int[3][3];
		for(int i = 0;i < 3;i++) {
			for(int j = 0;j < 3;j++) {
				C[i][j] = Integer.parseInt(sc.next());
			}
		}
		sc.close();
		int[] a = new int[3];
		int[] b = new int[3];
		a[0] = 0;
		b[0] = C[0][0];
		b[1] = C[0][1];
		b[2] = C[0][2];
		a[1] = C[1][0] - b[0];
		a[2] = C[2][0] - b[0];
		String ans = "Yes";
		for(int i = 0;i < 3;i++) {
			for(int j = 0;j < 3;j++) {
				if(a[i] + b[j] != C[i][j]) {
					ans = "No";
				}
			}
		}
		System.out.println(ans);
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[][] C = new int[3][3];
		for(int i = 0;i < 3;i++) {
			for(int j = 0;j < 3;j++) {
				C[i][j] = Integer.parseInt(sc.next());
			}
		}
		sc.close();
		int[] a = new int[3];
		int[] b = new int[3];
		a[0] = 0;
		b[0] = C[0][0];
		b[1] = C[0][1];
		b[2] = C[0][2];
		a[1] = C[1][0] - b[0];
		a[2] = C[2][0] - b[0];
		String ans = "Yes";
		for(int i = 0;i < 3;i++) {
			for(int j = 0;j < 3;j++) {
				if(a[i] + b[j] != C[i][j]) {
					ans = "No";
				}
			}
		}
		System.out.println(ans);
	}
}