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] = sc.nextInt();
				}
			}
			
			if(calc(c,0,0,0,1)&&calc(c,0,1,0,2)&&calc(c,1,0,1,1)&&calc(c,1,1,1,2)) {
				System.out.println("Yes");
			}else {
				System.out.println("No");
			}
			
			
	    }
		
		static boolean calc(int[][] c,int i,int j,int k, int l) {
			if((c[i][j]+c[i+1][j+1])==(c[k][l]+c[k+1][l-1])) {
				return true;
			}else {
				return false;
			}
		}
	} 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] = sc.nextInt();
				}
			}
			
			if(calc(c,0,0,0,1)&&calc(c,0,1,0,2)&&calc(c,1,0,1,1)&&calc(c,1,1,1,2)) {
				System.out.println("Yes");
			}else {
				System.out.println("No");
			}
			
			
	    }
		
		static boolean calc(int[][] c,int i,int j,int k, int l) {
			if((c[i][j]+c[i+1][j+1])==(c[k][l]+c[k+1][l-1])) {
				return true;
			}else {
				return false;
			}
		}
	} 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] = sc.nextInt();
				}
			}
			
			if(calc(c,0,0,0,1)&&calc(c,0,1,0,2)&&calc(c,1,0,1,1)&&calc(c,1,1,1,2)) {
				System.out.println("Yes");
			}else {
				System.out.println("No");
			}
			
			
	    } 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] = sc.nextInt();
				}
			}
			
			if(calc(c,0,0,0,1)&&calc(c,0,1,0,2)&&calc(c,1,0,1,1)&&calc(c,1,1,1,2)) {
				System.out.println("Yes");
			}else {
				System.out.println("No");
			}
			
			
	    } 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] = sc.nextInt();
				}
			} 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] = sc.nextInt();
				}
			} {
				for(int j=0;j<3;j++) {
					c[i][j] = sc.nextInt();
				}
			} for(int j=0;j<3;j++) {
					c[i][j] = sc.nextInt();
				} int j=0; int j=0; j 0 j<3 j 3 j++ j++ j {
					c[i][j] = sc.nextInt();
				} {
					c[i][j] = sc.nextInt();
				} c[i][j] = sc.nextInt() c[i][j] c[i] c i j sc.nextInt() sc.nextInt sc if(calc(c,0,0,0,1)&&calc(c,0,1,0,2)&&calc(c,1,0,1,1)&&calc(c,1,1,1,2)) {
				System.out.println("Yes");
			}else {
				System.out.println("No");
			} calc(c,0,0,0,1)&&calc(c,0,1,0,2)&&calc(c,1,0,1,1)&&calc(c,1,1,1,2) calc(c,1,0,1,1) calc(c,0,0,0,1)&&calc(c,0,1,0,2)&&calc(c,1,0,1,1)&&calc(c,1,1,1,2) calc(c,0,0,0,1) calc c 0 0 0 1 calc(c,0,1,0,2) calc c 0 1 0 2 calc(c,1,0,1,1) calc c 1 0 1 1 calc(c,1,1,1,2) calc c 1 1 1 2 {
				System.out.println("Yes");
			} System.out.println("Yes") System.out.println System.out System System.out "Yes" {
				System.out.println("No");
			} System.out.println("No") System.out.println System.out System System.out "No" String[] args args static boolean calc(int[][] c,int i,int j,int k, int l) {
			if((c[i][j]+c[i+1][j+1])==(c[k][l]+c[k+1][l-1])) {
				return true;
			}else {
				return false;
			}
		} calc {
			if((c[i][j]+c[i+1][j+1])==(c[k][l]+c[k+1][l-1])) {
				return true;
			}else {
				return false;
			}
		} if((c[i][j]+c[i+1][j+1])==(c[k][l]+c[k+1][l-1])) {
				return true;
			}else {
				return false;
			} (c[i][j]+c[i+1][j+1])==(c[k][l]+c[k+1][l-1]) (c[i][j]+c[i+1][j+1]) c[i][j] c[i] c i j c[i+1][j+1] c[i+1] c i+1 i 1 j+1 j 1 (c[k][l]+c[k+1][l-1]) c[k][l] c[k] c k l c[k+1][l-1] c[k+1] c k+1 k 1 l-1 l 1 {
				return true;
			} return true; true {
				return false;
			} return false; false int[][] c c int i i int j j int k k int l l 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] = sc.nextInt();
				}
			}
			
			if(calc(c,0,0,0,1)&&calc(c,0,1,0,2)&&calc(c,1,0,1,1)&&calc(c,1,1,1,2)) {
				System.out.println("Yes");
			}else {
				System.out.println("No");
			}
			
			
	    }
		
		static boolean calc(int[][] c,int i,int j,int k, int l) {
			if((c[i][j]+c[i+1][j+1])==(c[k][l]+c[k+1][l-1])) {
				return true;
			}else {
				return false;
			}
		}
	} 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] = sc.nextInt();
				}
			}
			
			if(calc(c,0,0,0,1)&&calc(c,0,1,0,2)&&calc(c,1,0,1,1)&&calc(c,1,1,1,2)) {
				System.out.println("Yes");
			}else {
				System.out.println("No");
			}
			
			
	    }
		
		static boolean calc(int[][] c,int i,int j,int k, int l) {
			if((c[i][j]+c[i+1][j+1])==(c[k][l]+c[k+1][l-1])) {
				return true;
			}else {
				return false;
			}
		}
	} 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] = sc.nextInt();
				}
			}
			
			if(calc(c,0,0,0,1)&&calc(c,0,1,0,2)&&calc(c,1,0,1,1)&&calc(c,1,1,1,2)) {
				System.out.println("Yes");
			}else {
				System.out.println("No");
			}
			
			
	    }
		
		static boolean calc(int[][] c,int i,int j,int k, int l) {
			if((c[i][j]+c[i+1][j+1])==(c[k][l]+c[k+1][l-1])) {
				return true;
			}else {
				return false;
			}
		}
	}
