
// int型のオーバーフローに注意
// 文字列の比較は==ではなく.equalsを使おう
// Stringの入力はnext();が丸い

import java.util.Scanner;

public class Main {

	public static void main(String args[]) {
		    Scanner sc = new Scanner(System.in);

		    int c11 = sc.nextInt();
		    int c12 = sc.nextInt();
		    int c13 = sc.nextInt();
		    int c21 = sc.nextInt();
		    int c22 = sc.nextInt();
		    int c23 = sc.nextInt();
		    int c31 = sc.nextInt();
		    int c32 = sc.nextInt();
		    int c33 = sc.nextInt();
		    int count = 0;
		    
		    if(c12 - c11== c22 - c21 && c22 - c21 == c32 - c31) {
		    	if(c13 - c12== c23 - c22 && c23 - c22 == c33 - c32) {
		    		if(c11 - c13== c21 - c23 && c21 - c23 == c31 - c33) {
		    			if(c21 -c11 == c22 -c12 && c22 - c12 == c23 - c13) {
		    				if(c31 -c21 == c32 -c22 && c32 - c22 == c33 - c23) {
		    					if(c11 -c31 == c12 -c32 && c12 - c32 == c13 - c33) {
				    				
				    			}
			    			}else {
			    				count++;
			    			}
		    			}else {
		    				count++;
		    			}
			    	}else {
			    		count++;
			    	}
		    	}else {
		    		count++;
		    	}
		    }else {
		    	count++;
		    }
		    if(count != 0) {
		    	System.out.println("No");
		    }else {
		    	System.out.println("Yes");
		    }
		    
		    sc.close(); }

	public static  int gcd(int a, int b) {
	    if (a < b) {
	        int tmp = a;
	        a = b;
	        b = tmp;
	    }

	    int r = -1;
	    while (r != 0) {
	        r = a % b;
	        a = b;
	        b = r;
	    }

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

	public static void main(String args[]) {
		    Scanner sc = new Scanner(System.in);

		    int c11 = sc.nextInt();
		    int c12 = sc.nextInt();
		    int c13 = sc.nextInt();
		    int c21 = sc.nextInt();
		    int c22 = sc.nextInt();
		    int c23 = sc.nextInt();
		    int c31 = sc.nextInt();
		    int c32 = sc.nextInt();
		    int c33 = sc.nextInt();
		    int count = 0;
		    
		    if(c12 - c11== c22 - c21 && c22 - c21 == c32 - c31) {
		    	if(c13 - c12== c23 - c22 && c23 - c22 == c33 - c32) {
		    		if(c11 - c13== c21 - c23 && c21 - c23 == c31 - c33) {
		    			if(c21 -c11 == c22 -c12 && c22 - c12 == c23 - c13) {
		    				if(c31 -c21 == c32 -c22 && c32 - c22 == c33 - c23) {
		    					if(c11 -c31 == c12 -c32 && c12 - c32 == c13 - c33) {
				    				
				    			}
			    			}else {
			    				count++;
			    			}
		    			}else {
		    				count++;
		    			}
			    	}else {
			    		count++;
			    	}
		    	}else {
		    		count++;
		    	}
		    }else {
		    	count++;
		    }
		    if(count != 0) {
		    	System.out.println("No");
		    }else {
		    	System.out.println("Yes");
		    }
		    
		    sc.close(); }

	public static  int gcd(int a, int b) {
	    if (a < b) {
	        int tmp = a;
	        a = b;
	        b = tmp;
	    }

	    int r = -1;
	    while (r != 0) {
	        r = a % b;
	        a = b;
	        b = r;
	    }

	    return a;
	}
} Main public static void main(String args[]) {
		    Scanner sc = new Scanner(System.in);

		    int c11 = sc.nextInt();
		    int c12 = sc.nextInt();
		    int c13 = sc.nextInt();
		    int c21 = sc.nextInt();
		    int c22 = sc.nextInt();
		    int c23 = sc.nextInt();
		    int c31 = sc.nextInt();
		    int c32 = sc.nextInt();
		    int c33 = sc.nextInt();
		    int count = 0;
		    
		    if(c12 - c11== c22 - c21 && c22 - c21 == c32 - c31) {
		    	if(c13 - c12== c23 - c22 && c23 - c22 == c33 - c32) {
		    		if(c11 - c13== c21 - c23 && c21 - c23 == c31 - c33) {
		    			if(c21 -c11 == c22 -c12 && c22 - c12 == c23 - c13) {
		    				if(c31 -c21 == c32 -c22 && c32 - c22 == c33 - c23) {
		    					if(c11 -c31 == c12 -c32 && c12 - c32 == c13 - c33) {
				    				
				    			}
			    			}else {
			    				count++;
			    			}
		    			}else {
		    				count++;
		    			}
			    	}else {
			    		count++;
			    	}
		    	}else {
		    		count++;
		    	}
		    }else {
		    	count++;
		    }
		    if(count != 0) {
		    	System.out.println("No");
		    }else {
		    	System.out.println("Yes");
		    }
		    
		    sc.close(); } main {
		    Scanner sc = new Scanner(System.in);

		    int c11 = sc.nextInt();
		    int c12 = sc.nextInt();
		    int c13 = sc.nextInt();
		    int c21 = sc.nextInt();
		    int c22 = sc.nextInt();
		    int c23 = sc.nextInt();
		    int c31 = sc.nextInt();
		    int c32 = sc.nextInt();
		    int c33 = sc.nextInt();
		    int count = 0;
		    
		    if(c12 - c11== c22 - c21 && c22 - c21 == c32 - c31) {
		    	if(c13 - c12== c23 - c22 && c23 - c22 == c33 - c32) {
		    		if(c11 - c13== c21 - c23 && c21 - c23 == c31 - c33) {
		    			if(c21 -c11 == c22 -c12 && c22 - c12 == c23 - c13) {
		    				if(c31 -c21 == c32 -c22 && c32 - c22 == c33 - c23) {
		    					if(c11 -c31 == c12 -c32 && c12 - c32 == c13 - c33) {
				    				
				    			}
			    			}else {
			    				count++;
			    			}
		    			}else {
		    				count++;
		    			}
			    	}else {
			    		count++;
			    	}
		    	}else {
		    		count++;
		    	}
		    }else {
		    	count++;
		    }
		    if(count != 0) {
		    	System.out.println("No");
		    }else {
		    	System.out.println("Yes");
		    }
		    
		    sc.close(); } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int c11 = sc.nextInt(); c11 sc.nextInt() sc.nextInt sc int c12 = sc.nextInt(); c12 sc.nextInt() sc.nextInt sc int c13 = sc.nextInt(); c13 sc.nextInt() sc.nextInt sc int c21 = sc.nextInt(); c21 sc.nextInt() sc.nextInt sc int c22 = sc.nextInt(); c22 sc.nextInt() sc.nextInt sc int c23 = sc.nextInt(); c23 sc.nextInt() sc.nextInt sc int c31 = sc.nextInt(); c31 sc.nextInt() sc.nextInt sc int c32 = sc.nextInt(); c32 sc.nextInt() sc.nextInt sc int c33 = sc.nextInt(); c33 sc.nextInt() sc.nextInt sc int count = 0; count 0 if(c12 - c11== c22 - c21 && c22 - c21 == c32 - c31) {
		    	if(c13 - c12== c23 - c22 && c23 - c22 == c33 - c32) {
		    		if(c11 - c13== c21 - c23 && c21 - c23 == c31 - c33) {
		    			if(c21 -c11 == c22 -c12 && c22 - c12 == c23 - c13) {
		    				if(c31 -c21 == c32 -c22 && c32 - c22 == c33 - c23) {
		    					if(c11 -c31 == c12 -c32 && c12 - c32 == c13 - c33) {
				    				
				    			}
			    			}else {
			    				count++;
			    			}
		    			}else {
		    				count++;
		    			}
			    	}else {
			    		count++;
			    	}
		    	}else {
		    		count++;
		    	}
		    }else {
		    	count++;
		    } c12 - c11== c22 - c21 && c22 - c21 == c32 - c31 c12 - c11== c22 - c21 c12 - c11 c12 c11 c22 - c21 c22 c21 c22 - c21 == c32 - c31 c22 - c21 c22 c21 c32 - c31 c32 c31 {
		    	if(c13 - c12== c23 - c22 && c23 - c22 == c33 - c32) {
		    		if(c11 - c13== c21 - c23 && c21 - c23 == c31 - c33) {
		    			if(c21 -c11 == c22 -c12 && c22 - c12 == c23 - c13) {
		    				if(c31 -c21 == c32 -c22 && c32 - c22 == c33 - c23) {
		    					if(c11 -c31 == c12 -c32 && c12 - c32 == c13 - c33) {
				    				
				    			}
			    			}else {
			    				count++;
			    			}
		    			}else {
		    				count++;
		    			}
			    	}else {
			    		count++;
			    	}
		    	}else {
		    		count++;
		    	}
		    } if(c13 - c12== c23 - c22 && c23 - c22 == c33 - c32) {
		    		if(c11 - c13== c21 - c23 && c21 - c23 == c31 - c33) {
		    			if(c21 -c11 == c22 -c12 && c22 - c12 == c23 - c13) {
		    				if(c31 -c21 == c32 -c22 && c32 - c22 == c33 - c23) {
		    					if(c11 -c31 == c12 -c32 && c12 - c32 == c13 - c33) {
				    				
				    			}
			    			}else {
			    				count++;
			    			}
		    			}else {
		    				count++;
		    			}
			    	}else {
			    		count++;
			    	}
		    	}else {
		    		count++;
		    	} c13 - c12== c23 - c22 && c23 - c22 == c33 - c32 c13 - c12== c23 - c22 c13 - c12 c13 c12 c23 - c22 c23 c22 c23 - c22 == c33 - c32 c23 - c22 c23 c22 c33 - c32 c33 c32 {
		    		if(c11 - c13== c21 - c23 && c21 - c23 == c31 - c33) {
		    			if(c21 -c11 == c22 -c12 && c22 - c12 == c23 - c13) {
		    				if(c31 -c21 == c32 -c22 && c32 - c22 == c33 - c23) {
		    					if(c11 -c31 == c12 -c32 && c12 - c32 == c13 - c33) {
				    				
				    			}
			    			}else {
			    				count++;
			    			}
		    			}else {
		    				count++;
		    			}
			    	}else {
			    		count++;
			    	}
		    	} if(c11 - c13== c21 - c23 && c21 - c23 == c31 - c33) {
		    			if(c21 -c11 == c22 -c12 && c22 - c12 == c23 - c13) {
		    				if(c31 -c21 == c32 -c22 && c32 - c22 == c33 - c23) {
		    					if(c11 -c31 == c12 -c32 && c12 - c32 == c13 - c33) {
				    				
				    			}
			    			}else {
			    				count++;
			    			}
		    			}else {
		    				count++;
		    			}
			    	}else {
			    		count++;
			    	} c11 - c13== c21 - c23 && c21 - c23 == c31 - c33 c11 - c13== c21 - c23 c11 - c13 c11 c13 c21 - c23 c21 c23 c21 - c23 == c31 - c33 c21 - c23 c21 c23 c31 - c33 c31 c33 {
		    			if(c21 -c11 == c22 -c12 && c22 - c12 == c23 - c13) {
		    				if(c31 -c21 == c32 -c22 && c32 - c22 == c33 - c23) {
		    					if(c11 -c31 == c12 -c32 && c12 - c32 == c13 - c33) {
				    				
				    			}
			    			}else {
			    				count++;
			    			}
		    			}else {
		    				count++;
		    			}
			    	} if(c21 -c11 == c22 -c12 && c22 - c12 == c23 - c13) {
		    				if(c31 -c21 == c32 -c22 && c32 - c22 == c33 - c23) {
		    					if(c11 -c31 == c12 -c32 && c12 - c32 == c13 - c33) {
				    				
				    			}
			    			}else {
			    				count++;
			    			}
		    			}else {
		    				count++;
		    			} c21 -c11 == c22 -c12 && c22 - c12 == c23 - c13 c21 -c11 == c22 -c12 c21 -c11 c21 c11 c22 -c12 c22 c12 c22 - c12 == c23 - c13 c22 - c12 c22 c12 c23 - c13 c23 c13 {
		    				if(c31 -c21 == c32 -c22 && c32 - c22 == c33 - c23) {
		    					if(c11 -c31 == c12 -c32 && c12 - c32 == c13 - c33) {
				    				
				    			}
			    			}else {
			    				count++;
			    			}
		    			} if(c31 -c21 == c32 -c22 && c32 - c22 == c33 - c23) {
		    					if(c11 -c31 == c12 -c32 && c12 - c32 == c13 - c33) {
				    				
				    			}
			    			}else {
			    				count++;
			    			} c31 -c21 == c32 -c22 && c32 - c22 == c33 - c23 c31 -c21 == c32 -c22 c31 -c21 c31 c21 c32 -c22 c32 c22 c32 - c22 == c33 - c23 c32 - c22 c32 c22 c33 - c23 c33 c23 {
		    					if(c11 -c31 == c12 -c32 && c12 - c32 == c13 - c33) {
				    				
				    			}
			    			} if(c11 -c31 == c12 -c32 && c12 - c32 == c13 - c33) {
				    				
				    			} c11 -c31 == c12 -c32 && c12 - c32 == c13 - c33 c11 -c31 == c12 -c32 c11 -c31 c11 c31 c12 -c32 c12 c32 c12 - c32 == c13 - c33 c12 - c32 c12 c32 c13 - c33 c13 c33 {
				    				
				    			} {
			    				count++;
			    			} count++ count {
		    				count++;
		    			} count++ count {
			    		count++;
			    	} count++ count {
		    		count++;
		    	} count++ count {
		    	count++;
		    } count++ count if(count != 0) {
		    	System.out.println("No");
		    }else {
		    	System.out.println("Yes");
		    } count != 0 count 0 {
		    	System.out.println("No");
		    } System.out.println("No") System.out.println System.out System System.out "No" {
		    	System.out.println("Yes");
		    } System.out.println("Yes") System.out.println System.out System System.out "Yes" sc.close() sc.close sc String args[] args public static  int gcd(int a, int b) {
	    if (a < b) {
	        int tmp = a;
	        a = b;
	        b = tmp;
	    }

	    int r = -1;
	    while (r != 0) {
	        r = a % b;
	        a = b;
	        b = r;
	    }

	    return a;
	} gcd {
	    if (a < b) {
	        int tmp = a;
	        a = b;
	        b = tmp;
	    }

	    int r = -1;
	    while (r != 0) {
	        r = a % b;
	        a = b;
	        b = r;
	    }

	    return a;
	} if (a < b) {
	        int tmp = a;
	        a = b;
	        b = tmp;
	    } a < b a b {
	        int tmp = a;
	        a = b;
	        b = tmp;
	    } int tmp = a; tmp a a = b a b b = tmp b tmp int r = -1; r -1 1 while (r != 0) {
	        r = a % b;
	        a = b;
	        b = r;
	    } r != 0 r 0 {
	        r = a % b;
	        a = b;
	        b = r;
	    } r = a % b r a % b a b a = b a b b = r b r return a; a int a a int b b public class Main {

	public static void main(String args[]) {
		    Scanner sc = new Scanner(System.in);

		    int c11 = sc.nextInt();
		    int c12 = sc.nextInt();
		    int c13 = sc.nextInt();
		    int c21 = sc.nextInt();
		    int c22 = sc.nextInt();
		    int c23 = sc.nextInt();
		    int c31 = sc.nextInt();
		    int c32 = sc.nextInt();
		    int c33 = sc.nextInt();
		    int count = 0;
		    
		    if(c12 - c11== c22 - c21 && c22 - c21 == c32 - c31) {
		    	if(c13 - c12== c23 - c22 && c23 - c22 == c33 - c32) {
		    		if(c11 - c13== c21 - c23 && c21 - c23 == c31 - c33) {
		    			if(c21 -c11 == c22 -c12 && c22 - c12 == c23 - c13) {
		    				if(c31 -c21 == c32 -c22 && c32 - c22 == c33 - c23) {
		    					if(c11 -c31 == c12 -c32 && c12 - c32 == c13 - c33) {
				    				
				    			}
			    			}else {
			    				count++;
			    			}
		    			}else {
		    				count++;
		    			}
			    	}else {
			    		count++;
			    	}
		    	}else {
		    		count++;
		    	}
		    }else {
		    	count++;
		    }
		    if(count != 0) {
		    	System.out.println("No");
		    }else {
		    	System.out.println("Yes");
		    }
		    
		    sc.close(); }

	public static  int gcd(int a, int b) {
	    if (a < b) {
	        int tmp = a;
	        a = b;
	        b = tmp;
	    }

	    int r = -1;
	    while (r != 0) {
	        r = a % b;
	        a = b;
	        b = r;
	    }

	    return a;
	}
} public class Main {

	public static void main(String args[]) {
		    Scanner sc = new Scanner(System.in);

		    int c11 = sc.nextInt();
		    int c12 = sc.nextInt();
		    int c13 = sc.nextInt();
		    int c21 = sc.nextInt();
		    int c22 = sc.nextInt();
		    int c23 = sc.nextInt();
		    int c31 = sc.nextInt();
		    int c32 = sc.nextInt();
		    int c33 = sc.nextInt();
		    int count = 0;
		    
		    if(c12 - c11== c22 - c21 && c22 - c21 == c32 - c31) {
		    	if(c13 - c12== c23 - c22 && c23 - c22 == c33 - c32) {
		    		if(c11 - c13== c21 - c23 && c21 - c23 == c31 - c33) {
		    			if(c21 -c11 == c22 -c12 && c22 - c12 == c23 - c13) {
		    				if(c31 -c21 == c32 -c22 && c32 - c22 == c33 - c23) {
		    					if(c11 -c31 == c12 -c32 && c12 - c32 == c13 - c33) {
				    				
				    			}
			    			}else {
			    				count++;
			    			}
		    			}else {
		    				count++;
		    			}
			    	}else {
			    		count++;
			    	}
		    	}else {
		    		count++;
		    	}
		    }else {
		    	count++;
		    }
		    if(count != 0) {
		    	System.out.println("No");
		    }else {
		    	System.out.println("Yes");
		    }
		    
		    sc.close(); }

	public static  int gcd(int a, int b) {
	    if (a < b) {
	        int tmp = a;
	        a = b;
	        b = tmp;
	    }

	    int r = -1;
	    while (r != 0) {
	        r = a % b;
	        a = b;
	        b = r;
	    }

	    return a;
	}
} Main

// int型のオーバーフローに注意
// 文字列の比較は==ではなく.equalsを使おう
// Stringの入力はnext();が丸い

import java.util.Scanner;

public class Main {

	public static void main(String args[]) {
		    Scanner sc = new Scanner(System.in);

		    int c11 = sc.nextInt();
		    int c12 = sc.nextInt();
		    int c13 = sc.nextInt();
		    int c21 = sc.nextInt();
		    int c22 = sc.nextInt();
		    int c23 = sc.nextInt();
		    int c31 = sc.nextInt();
		    int c32 = sc.nextInt();
		    int c33 = sc.nextInt();
		    int count = 0;
		    
		    if(c12 - c11== c22 - c21 && c22 - c21 == c32 - c31) {
		    	if(c13 - c12== c23 - c22 && c23 - c22 == c33 - c32) {
		    		if(c11 - c13== c21 - c23 && c21 - c23 == c31 - c33) {
		    			if(c21 -c11 == c22 -c12 && c22 - c12 == c23 - c13) {
		    				if(c31 -c21 == c32 -c22 && c32 - c22 == c33 - c23) {
		    					if(c11 -c31 == c12 -c32 && c12 - c32 == c13 - c33) {
				    				
				    			}
			    			}else {
			    				count++;
			    			}
		    			}else {
		    				count++;
		    			}
			    	}else {
			    		count++;
			    	}
		    	}else {
		    		count++;
		    	}
		    }else {
		    	count++;
		    }
		    if(count != 0) {
		    	System.out.println("No");
		    }else {
		    	System.out.println("Yes");
		    }
		    
		    sc.close(); }

	public static  int gcd(int a, int b) {
	    if (a < b) {
	        int tmp = a;
	        a = b;
	        b = tmp;
	    }

	    int r = -1;
	    while (r != 0) {
	        r = a % b;
	        a = b;
	        b = r;
	    }

	    return a;
	}
}
