import java.util.Scanner;

public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			int [][]x = new int[3][3];
			
			x[0][0] = scan.nextInt();
			x[0][1] = scan.nextInt();
			x[0][2] = scan.nextInt();
			x[1][0] = scan.nextInt();
			x[1][1] = scan.nextInt();
			x[1][2] = scan.nextInt();
			x[2][0] = scan.nextInt();
			x[2][1] = scan.nextInt();
			x[2][2] = scan.nextInt();
			
			int[]a = new int[3];
			int[]b = new int[3];
			
			int ok = 1;
			
			
			for(int i = 0;i<=100;i++) {
				a[0] = i;
				b[0] = x[0][0]-a[0];
				
				a[1] = x[1][0]-b[0];
				a[2] = x[2][0]-b[0];
				b[1] = x[0][1]-a[0];
				b[2] = x[0][2]-a[0];
				if(0<=a[1]&&a[1]<=100&&0<=a[2]&&a[2]<=100&&0<=b[1]&&b[1]<=100&&0<=b[2]&&b[2]<=100) {
					if(a[1]+b[1]==x[1][1]&&a[1]+b[2]==x[1][2]&&a[2]+b[1]==x[2][1]&&a[2]+b[2]==x[2][2]){
						System.out.println("Yes");
						System.exit(0);
					}
				}
			}
			
			
			System.out.println("No");
			
			
			
			
			
			
			
			
			
		}
		
		
	}
		

} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			int [][]x = new int[3][3];
			
			x[0][0] = scan.nextInt();
			x[0][1] = scan.nextInt();
			x[0][2] = scan.nextInt();
			x[1][0] = scan.nextInt();
			x[1][1] = scan.nextInt();
			x[1][2] = scan.nextInt();
			x[2][0] = scan.nextInt();
			x[2][1] = scan.nextInt();
			x[2][2] = scan.nextInt();
			
			int[]a = new int[3];
			int[]b = new int[3];
			
			int ok = 1;
			
			
			for(int i = 0;i<=100;i++) {
				a[0] = i;
				b[0] = x[0][0]-a[0];
				
				a[1] = x[1][0]-b[0];
				a[2] = x[2][0]-b[0];
				b[1] = x[0][1]-a[0];
				b[2] = x[0][2]-a[0];
				if(0<=a[1]&&a[1]<=100&&0<=a[2]&&a[2]<=100&&0<=b[1]&&b[1]<=100&&0<=b[2]&&b[2]<=100) {
					if(a[1]+b[1]==x[1][1]&&a[1]+b[2]==x[1][2]&&a[2]+b[1]==x[2][1]&&a[2]+b[2]==x[2][2]){
						System.out.println("Yes");
						System.exit(0);
					}
				}
			}
			
			
			System.out.println("No");
			
			
			
			
			
			
			
			
			
		}
		
		
	}
		

} Main public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			int [][]x = new int[3][3];
			
			x[0][0] = scan.nextInt();
			x[0][1] = scan.nextInt();
			x[0][2] = scan.nextInt();
			x[1][0] = scan.nextInt();
			x[1][1] = scan.nextInt();
			x[1][2] = scan.nextInt();
			x[2][0] = scan.nextInt();
			x[2][1] = scan.nextInt();
			x[2][2] = scan.nextInt();
			
			int[]a = new int[3];
			int[]b = new int[3];
			
			int ok = 1;
			
			
			for(int i = 0;i<=100;i++) {
				a[0] = i;
				b[0] = x[0][0]-a[0];
				
				a[1] = x[1][0]-b[0];
				a[2] = x[2][0]-b[0];
				b[1] = x[0][1]-a[0];
				b[2] = x[0][2]-a[0];
				if(0<=a[1]&&a[1]<=100&&0<=a[2]&&a[2]<=100&&0<=b[1]&&b[1]<=100&&0<=b[2]&&b[2]<=100) {
					if(a[1]+b[1]==x[1][1]&&a[1]+b[2]==x[1][2]&&a[2]+b[1]==x[2][1]&&a[2]+b[2]==x[2][2]){
						System.out.println("Yes");
						System.exit(0);
					}
				}
			}
			
			
			System.out.println("No");
			
			
			
			
			
			
			
			
			
		}
		
		
	} main {
		try(Scanner scan = new Scanner(System.in)){
			
			int [][]x = new int[3][3];
			
			x[0][0] = scan.nextInt();
			x[0][1] = scan.nextInt();
			x[0][2] = scan.nextInt();
			x[1][0] = scan.nextInt();
			x[1][1] = scan.nextInt();
			x[1][2] = scan.nextInt();
			x[2][0] = scan.nextInt();
			x[2][1] = scan.nextInt();
			x[2][2] = scan.nextInt();
			
			int[]a = new int[3];
			int[]b = new int[3];
			
			int ok = 1;
			
			
			for(int i = 0;i<=100;i++) {
				a[0] = i;
				b[0] = x[0][0]-a[0];
				
				a[1] = x[1][0]-b[0];
				a[2] = x[2][0]-b[0];
				b[1] = x[0][1]-a[0];
				b[2] = x[0][2]-a[0];
				if(0<=a[1]&&a[1]<=100&&0<=a[2]&&a[2]<=100&&0<=b[1]&&b[1]<=100&&0<=b[2]&&b[2]<=100) {
					if(a[1]+b[1]==x[1][1]&&a[1]+b[2]==x[1][2]&&a[2]+b[1]==x[2][1]&&a[2]+b[2]==x[2][2]){
						System.out.println("Yes");
						System.exit(0);
					}
				}
			}
			
			
			System.out.println("No");
			
			
			
			
			
			
			
			
			
		}
		
		
	} try(Scanner scan = new Scanner(System.in)){
			
			int [][]x = new int[3][3];
			
			x[0][0] = scan.nextInt();
			x[0][1] = scan.nextInt();
			x[0][2] = scan.nextInt();
			x[1][0] = scan.nextInt();
			x[1][1] = scan.nextInt();
			x[1][2] = scan.nextInt();
			x[2][0] = scan.nextInt();
			x[2][1] = scan.nextInt();
			x[2][2] = scan.nextInt();
			
			int[]a = new int[3];
			int[]b = new int[3];
			
			int ok = 1;
			
			
			for(int i = 0;i<=100;i++) {
				a[0] = i;
				b[0] = x[0][0]-a[0];
				
				a[1] = x[1][0]-b[0];
				a[2] = x[2][0]-b[0];
				b[1] = x[0][1]-a[0];
				b[2] = x[0][2]-a[0];
				if(0<=a[1]&&a[1]<=100&&0<=a[2]&&a[2]<=100&&0<=b[1]&&b[1]<=100&&0<=b[2]&&b[2]<=100) {
					if(a[1]+b[1]==x[1][1]&&a[1]+b[2]==x[1][2]&&a[2]+b[1]==x[2][1]&&a[2]+b[2]==x[2][2]){
						System.out.println("Yes");
						System.exit(0);
					}
				}
			}
			
			
			System.out.println("No");
			
			
			
			
			
			
			
			
			
		} {
			
			int [][]x = new int[3][3];
			
			x[0][0] = scan.nextInt();
			x[0][1] = scan.nextInt();
			x[0][2] = scan.nextInt();
			x[1][0] = scan.nextInt();
			x[1][1] = scan.nextInt();
			x[1][2] = scan.nextInt();
			x[2][0] = scan.nextInt();
			x[2][1] = scan.nextInt();
			x[2][2] = scan.nextInt();
			
			int[]a = new int[3];
			int[]b = new int[3];
			
			int ok = 1;
			
			
			for(int i = 0;i<=100;i++) {
				a[0] = i;
				b[0] = x[0][0]-a[0];
				
				a[1] = x[1][0]-b[0];
				a[2] = x[2][0]-b[0];
				b[1] = x[0][1]-a[0];
				b[2] = x[0][2]-a[0];
				if(0<=a[1]&&a[1]<=100&&0<=a[2]&&a[2]<=100&&0<=b[1]&&b[1]<=100&&0<=b[2]&&b[2]<=100) {
					if(a[1]+b[1]==x[1][1]&&a[1]+b[2]==x[1][2]&&a[2]+b[1]==x[2][1]&&a[2]+b[2]==x[2][2]){
						System.out.println("Yes");
						System.exit(0);
					}
				}
			}
			
			
			System.out.println("No");
			
			
			
			
			
			
			
			
			
		} Scanner scan = new Scanner(System.in) Scanner scan = new Scanner(System.in) new Scanner(System.in) int [][]x = new int[3][3]; x new int[3][3] 3 3 x[0][0] = scan.nextInt() x[0][0] x[0] x 0 0 scan.nextInt() scan.nextInt scan x[0][1] = scan.nextInt() x[0][1] x[0] x 0 1 scan.nextInt() scan.nextInt scan x[0][2] = scan.nextInt() x[0][2] x[0] x 0 2 scan.nextInt() scan.nextInt scan x[1][0] = scan.nextInt() x[1][0] x[1] x 1 0 scan.nextInt() scan.nextInt scan x[1][1] = scan.nextInt() x[1][1] x[1] x 1 1 scan.nextInt() scan.nextInt scan x[1][2] = scan.nextInt() x[1][2] x[1] x 1 2 scan.nextInt() scan.nextInt scan x[2][0] = scan.nextInt() x[2][0] x[2] x 2 0 scan.nextInt() scan.nextInt scan x[2][1] = scan.nextInt() x[2][1] x[2] x 2 1 scan.nextInt() scan.nextInt scan x[2][2] = scan.nextInt() x[2][2] x[2] x 2 2 scan.nextInt() scan.nextInt scan int[]a = new int[3]; a new int[3] 3 int[]b = new int[3]; b new int[3] 3 int ok = 1; ok 1 for(int i = 0;i<=100;i++) {
				a[0] = i;
				b[0] = x[0][0]-a[0];
				
				a[1] = x[1][0]-b[0];
				a[2] = x[2][0]-b[0];
				b[1] = x[0][1]-a[0];
				b[2] = x[0][2]-a[0];
				if(0<=a[1]&&a[1]<=100&&0<=a[2]&&a[2]<=100&&0<=b[1]&&b[1]<=100&&0<=b[2]&&b[2]<=100) {
					if(a[1]+b[1]==x[1][1]&&a[1]+b[2]==x[1][2]&&a[2]+b[1]==x[2][1]&&a[2]+b[2]==x[2][2]){
						System.out.println("Yes");
						System.exit(0);
					}
				}
			} int i = 0; int i = 0; i 0 i<=100 i 100 i++ i++ i {
				a[0] = i;
				b[0] = x[0][0]-a[0];
				
				a[1] = x[1][0]-b[0];
				a[2] = x[2][0]-b[0];
				b[1] = x[0][1]-a[0];
				b[2] = x[0][2]-a[0];
				if(0<=a[1]&&a[1]<=100&&0<=a[2]&&a[2]<=100&&0<=b[1]&&b[1]<=100&&0<=b[2]&&b[2]<=100) {
					if(a[1]+b[1]==x[1][1]&&a[1]+b[2]==x[1][2]&&a[2]+b[1]==x[2][1]&&a[2]+b[2]==x[2][2]){
						System.out.println("Yes");
						System.exit(0);
					}
				}
			} {
				a[0] = i;
				b[0] = x[0][0]-a[0];
				
				a[1] = x[1][0]-b[0];
				a[2] = x[2][0]-b[0];
				b[1] = x[0][1]-a[0];
				b[2] = x[0][2]-a[0];
				if(0<=a[1]&&a[1]<=100&&0<=a[2]&&a[2]<=100&&0<=b[1]&&b[1]<=100&&0<=b[2]&&b[2]<=100) {
					if(a[1]+b[1]==x[1][1]&&a[1]+b[2]==x[1][2]&&a[2]+b[1]==x[2][1]&&a[2]+b[2]==x[2][2]){
						System.out.println("Yes");
						System.exit(0);
					}
				}
			} a[0] = i a[0] a 0 i b[0] = x[0][0]-a[0] b[0] b 0 x[0][0]-a[0] x[0][0] x[0] x 0 0 a[0] a 0 a[1] = x[1][0]-b[0] a[1] a 1 x[1][0]-b[0] x[1][0] x[1] x 1 0 b[0] b 0 a[2] = x[2][0]-b[0] a[2] a 2 x[2][0]-b[0] x[2][0] x[2] x 2 0 b[0] b 0 b[1] = x[0][1]-a[0] b[1] b 1 x[0][1]-a[0] x[0][1] x[0] x 0 1 a[0] a 0 b[2] = x[0][2]-a[0] b[2] b 2 x[0][2]-a[0] x[0][2] x[0] x 0 2 a[0] a 0 if(0<=a[1]&&a[1]<=100&&0<=a[2]&&a[2]<=100&&0<=b[1]&&b[1]<=100&&0<=b[2]&&b[2]<=100) {
					if(a[1]+b[1]==x[1][1]&&a[1]+b[2]==x[1][2]&&a[2]+b[1]==x[2][1]&&a[2]+b[2]==x[2][2]){
						System.out.println("Yes");
						System.exit(0);
					}
				} 0<=a[1]&&a[1]<=100&&0<=a[2]&&a[2]<=100&&0<=b[1]&&b[1]<=100&&0<=b[2]&&b[2]<=100 0<=b[2] b[1]<=100 0<=b[1] a[2]<=100 0<=a[2] 0<=a[1]&&a[1]<=100&&0<=a[2]&&a[2]<=100&&0<=b[1]&&b[1]<=100&&0<=b[2]&&b[2]<=100 0<=a[1] 0 a[1] a 1 a[1]<=100 a[1] a 1 100 0<=a[2] 0 a[2] a 2 a[2]<=100 a[2] a 2 100 0<=b[1] 0 b[1] b 1 b[1]<=100 b[1] b 1 100 0<=b[2] 0 b[2] b 2 b[2]<=100 b[2] b 2 100 {
					if(a[1]+b[1]==x[1][1]&&a[1]+b[2]==x[1][2]&&a[2]+b[1]==x[2][1]&&a[2]+b[2]==x[2][2]){
						System.out.println("Yes");
						System.exit(0);
					}
				} if(a[1]+b[1]==x[1][1]&&a[1]+b[2]==x[1][2]&&a[2]+b[1]==x[2][1]&&a[2]+b[2]==x[2][2]){
						System.out.println("Yes");
						System.exit(0);
					} a[1]+b[1]==x[1][1]&&a[1]+b[2]==x[1][2]&&a[2]+b[1]==x[2][1]&&a[2]+b[2]==x[2][2] a[2]+b[1]==x[2][1] a[1]+b[1]==x[1][1]&&a[1]+b[2]==x[1][2]&&a[2]+b[1]==x[2][1]&&a[2]+b[2]==x[2][2] a[1]+b[1]==x[1][1] a[1]+b[1] a[1] a 1 b[1] b 1 x[1][1] x[1] x 1 1 a[1]+b[2]==x[1][2] a[1]+b[2] a[1] a 1 b[2] b 2 x[1][2] x[1] x 1 2 a[2]+b[1]==x[2][1] a[2]+b[1] a[2] a 2 b[1] b 1 x[2][1] x[2] x 2 1 a[2]+b[2]==x[2][2] a[2]+b[2] a[2] a 2 b[2] b 2 x[2][2] x[2] x 2 2 {
						System.out.println("Yes");
						System.exit(0);
					} System.out.println("Yes") System.out.println System.out System System.out "Yes" System.exit(0) System.exit System 0 System.out.println("No") System.out.println System.out System System.out "No" String[]args args public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			int [][]x = new int[3][3];
			
			x[0][0] = scan.nextInt();
			x[0][1] = scan.nextInt();
			x[0][2] = scan.nextInt();
			x[1][0] = scan.nextInt();
			x[1][1] = scan.nextInt();
			x[1][2] = scan.nextInt();
			x[2][0] = scan.nextInt();
			x[2][1] = scan.nextInt();
			x[2][2] = scan.nextInt();
			
			int[]a = new int[3];
			int[]b = new int[3];
			
			int ok = 1;
			
			
			for(int i = 0;i<=100;i++) {
				a[0] = i;
				b[0] = x[0][0]-a[0];
				
				a[1] = x[1][0]-b[0];
				a[2] = x[2][0]-b[0];
				b[1] = x[0][1]-a[0];
				b[2] = x[0][2]-a[0];
				if(0<=a[1]&&a[1]<=100&&0<=a[2]&&a[2]<=100&&0<=b[1]&&b[1]<=100&&0<=b[2]&&b[2]<=100) {
					if(a[1]+b[1]==x[1][1]&&a[1]+b[2]==x[1][2]&&a[2]+b[1]==x[2][1]&&a[2]+b[2]==x[2][2]){
						System.out.println("Yes");
						System.exit(0);
					}
				}
			}
			
			
			System.out.println("No");
			
			
			
			
			
			
			
			
			
		}
		
		
	}
		

} public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			int [][]x = new int[3][3];
			
			x[0][0] = scan.nextInt();
			x[0][1] = scan.nextInt();
			x[0][2] = scan.nextInt();
			x[1][0] = scan.nextInt();
			x[1][1] = scan.nextInt();
			x[1][2] = scan.nextInt();
			x[2][0] = scan.nextInt();
			x[2][1] = scan.nextInt();
			x[2][2] = scan.nextInt();
			
			int[]a = new int[3];
			int[]b = new int[3];
			
			int ok = 1;
			
			
			for(int i = 0;i<=100;i++) {
				a[0] = i;
				b[0] = x[0][0]-a[0];
				
				a[1] = x[1][0]-b[0];
				a[2] = x[2][0]-b[0];
				b[1] = x[0][1]-a[0];
				b[2] = x[0][2]-a[0];
				if(0<=a[1]&&a[1]<=100&&0<=a[2]&&a[2]<=100&&0<=b[1]&&b[1]<=100&&0<=b[2]&&b[2]<=100) {
					if(a[1]+b[1]==x[1][1]&&a[1]+b[2]==x[1][2]&&a[2]+b[1]==x[2][1]&&a[2]+b[2]==x[2][2]){
						System.out.println("Yes");
						System.exit(0);
					}
				}
			}
			
			
			System.out.println("No");
			
			
			
			
			
			
			
			
			
		}
		
		
	}
		

} Main
import java.util.Scanner;

public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			int [][]x = new int[3][3];
			
			x[0][0] = scan.nextInt();
			x[0][1] = scan.nextInt();
			x[0][2] = scan.nextInt();
			x[1][0] = scan.nextInt();
			x[1][1] = scan.nextInt();
			x[1][2] = scan.nextInt();
			x[2][0] = scan.nextInt();
			x[2][1] = scan.nextInt();
			x[2][2] = scan.nextInt();
			
			int[]a = new int[3];
			int[]b = new int[3];
			
			int ok = 1;
			
			
			for(int i = 0;i<=100;i++) {
				a[0] = i;
				b[0] = x[0][0]-a[0];
				
				a[1] = x[1][0]-b[0];
				a[2] = x[2][0]-b[0];
				b[1] = x[0][1]-a[0];
				b[2] = x[0][2]-a[0];
				if(0<=a[1]&&a[1]<=100&&0<=a[2]&&a[2]<=100&&0<=b[1]&&b[1]<=100&&0<=b[2]&&b[2]<=100) {
					if(a[1]+b[1]==x[1][1]&&a[1]+b[2]==x[1][2]&&a[2]+b[1]==x[2][1]&&a[2]+b[2]==x[2][2]){
						System.out.println("Yes");
						System.exit(0);
					}
				}
			}
			
			
			System.out.println("No");
			
			
			
			
			
			
			
			
			
		}
		
		
	}
		

}
