import java.util.*;

class Main{
	
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		
		int C[][] = new int[3][3];
		
		int sum = 0;
		
		for(int i = 0 ; i < 3 ; i ++){
			for(int j = 0 ; j < 3 ; j ++){
				C[i][j] = sc.nextInt();
				sum = sum + C[i][j] ;
			}
		}
		
		boolean result = false;
		
//		System.out.println(sum);
		
		if(sum % 3 == 0){
			
			int D = sum / 3;
			if(D == C[0][0] + C[1][1] + C[2][2] &&
			   D == C[0][1] + C[1][2] + C[2][0] &&
			   D == C[0][2] + C[1][0] + C[2][1] &&
			   D == C[0][2] + C[1][1] + C[2][0] &&
			   D == C[0][1] + C[1][0] + C[2][2] &&
			   D == C[0][0] + C[1][2] + C[2][1] ){
			   	result = true;
			   }
		}
		
		System.out.println( result ? "Yes" : "No");
	}
}

 import java.util.*; util.* java class Main{
	
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		
		int C[][] = new int[3][3];
		
		int sum = 0;
		
		for(int i = 0 ; i < 3 ; i ++){
			for(int j = 0 ; j < 3 ; j ++){
				C[i][j] = sc.nextInt();
				sum = sum + C[i][j] ;
			}
		}
		
		boolean result = false;
		
//		System.out.println(sum);
		
		if(sum % 3 == 0){
			
			int D = sum / 3;
			if(D == C[0][0] + C[1][1] + C[2][2] &&
			   D == C[0][1] + C[1][2] + C[2][0] &&
			   D == C[0][2] + C[1][0] + C[2][1] &&
			   D == C[0][2] + C[1][1] + C[2][0] &&
			   D == C[0][1] + C[1][0] + C[2][2] &&
			   D == C[0][0] + C[1][2] + C[2][1] ){
			   	result = true;
			   }
		}
		
		System.out.println( result ? "Yes" : "No");
	}
} Main public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		
		int C[][] = new int[3][3];
		
		int sum = 0;
		
		for(int i = 0 ; i < 3 ; i ++){
			for(int j = 0 ; j < 3 ; j ++){
				C[i][j] = sc.nextInt();
				sum = sum + C[i][j] ;
			}
		}
		
		boolean result = false;
		
//		System.out.println(sum);
		
		if(sum % 3 == 0){
			
			int D = sum / 3;
			if(D == C[0][0] + C[1][1] + C[2][2] &&
			   D == C[0][1] + C[1][2] + C[2][0] &&
			   D == C[0][2] + C[1][0] + C[2][1] &&
			   D == C[0][2] + C[1][1] + C[2][0] &&
			   D == C[0][1] + C[1][0] + C[2][2] &&
			   D == C[0][0] + C[1][2] + C[2][1] ){
			   	result = true;
			   }
		}
		
		System.out.println( result ? "Yes" : "No");
	} main {
		
		Scanner sc = new Scanner(System.in);
		
		int C[][] = new int[3][3];
		
		int sum = 0;
		
		for(int i = 0 ; i < 3 ; i ++){
			for(int j = 0 ; j < 3 ; j ++){
				C[i][j] = sc.nextInt();
				sum = sum + C[i][j] ;
			}
		}
		
		boolean result = false;
		
//		System.out.println(sum);
		
		if(sum % 3 == 0){
			
			int D = sum / 3;
			if(D == C[0][0] + C[1][1] + C[2][2] &&
			   D == C[0][1] + C[1][2] + C[2][0] &&
			   D == C[0][2] + C[1][0] + C[2][1] &&
			   D == C[0][2] + C[1][1] + C[2][0] &&
			   D == C[0][1] + C[1][0] + C[2][2] &&
			   D == C[0][0] + C[1][2] + C[2][1] ){
			   	result = true;
			   }
		}
		
		System.out.println( result ? "Yes" : "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 int sum = 0; sum 0 for(int i = 0 ; i < 3 ; i ++){
			for(int j = 0 ; j < 3 ; j ++){
				C[i][j] = sc.nextInt();
				sum = sum + C[i][j] ;
			}
		} 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();
				sum = sum + C[i][j] ;
			}
		} {
			for(int j = 0 ; j < 3 ; j ++){
				C[i][j] = sc.nextInt();
				sum = sum + C[i][j] ;
			}
		} for(int j = 0 ; j < 3 ; j ++){
				C[i][j] = sc.nextInt();
				sum = sum + C[i][j] ;
			} int j = 0 ; int j = 0 ; j 0 j < 3 j 3 j ++ j ++ j {
				C[i][j] = sc.nextInt();
				sum = sum + C[i][j] ;
			} {
				C[i][j] = sc.nextInt();
				sum = sum + C[i][j] ;
			} C[i][j] = sc.nextInt() C[i][j] C[i] C i j sc.nextInt() sc.nextInt sc sum = sum + C[i][j] sum sum + C[i][j] sum C[i][j] C[i] C i j boolean result = false; result false if(sum % 3 == 0){
			
			int D = sum / 3;
			if(D == C[0][0] + C[1][1] + C[2][2] &&
			   D == C[0][1] + C[1][2] + C[2][0] &&
			   D == C[0][2] + C[1][0] + C[2][1] &&
			   D == C[0][2] + C[1][1] + C[2][0] &&
			   D == C[0][1] + C[1][0] + C[2][2] &&
			   D == C[0][0] + C[1][2] + C[2][1] ){
			   	result = true;
			   }
		} sum % 3 == 0 sum % 3 sum 3 0 {
			
			int D = sum / 3;
			if(D == C[0][0] + C[1][1] + C[2][2] &&
			   D == C[0][1] + C[1][2] + C[2][0] &&
			   D == C[0][2] + C[1][0] + C[2][1] &&
			   D == C[0][2] + C[1][1] + C[2][0] &&
			   D == C[0][1] + C[1][0] + C[2][2] &&
			   D == C[0][0] + C[1][2] + C[2][1] ){
			   	result = true;
			   }
		} int D = sum / 3; D sum / 3 sum 3 if(D == C[0][0] + C[1][1] + C[2][2] &&
			   D == C[0][1] + C[1][2] + C[2][0] &&
			   D == C[0][2] + C[1][0] + C[2][1] &&
			   D == C[0][2] + C[1][1] + C[2][0] &&
			   D == C[0][1] + C[1][0] + C[2][2] &&
			   D == C[0][0] + C[1][2] + C[2][1] ){
			   	result = true;
			   } D == C[0][0] + C[1][1] + C[2][2] &&
			   D == C[0][1] + C[1][2] + C[2][0] &&
			   D == C[0][2] + C[1][0] + C[2][1] &&
			   D == C[0][2] + C[1][1] + C[2][0] &&
			   D == C[0][1] + C[1][0] + C[2][2] &&
			   D == C[0][0] + C[1][2] + C[2][1] D == C[0][1] + C[1][0] + C[2][2] D == C[0][2] + C[1][1] + C[2][0] D == C[0][2] + C[1][0] + C[2][1] D == C[0][0] + C[1][1] + C[2][2] &&
			   D == C[0][1] + C[1][2] + C[2][0] &&
			   D == C[0][2] + C[1][0] + C[2][1] &&
			   D == C[0][2] + C[1][1] + C[2][0] &&
			   D == C[0][1] + C[1][0] + C[2][2] &&
			   D == C[0][0] + C[1][2] + C[2][1] D == C[0][0] + C[1][1] + C[2][2] D C[0][0] + C[1][1] + C[2][2] C[0][0] + C[1][1] + C[2][2] C[0][0] C[0] C 0 0 C[1][1] C[1] C 1 1 C[2][2] C[2] C 2 2 D == C[0][1] + C[1][2] + C[2][0] D C[0][1] + C[1][2] + C[2][0] C[0][1] + C[1][2] + C[2][0] C[0][1] C[0] C 0 1 C[1][2] C[1] C 1 2 C[2][0] C[2] C 2 0 D == C[0][2] + C[1][0] + C[2][1] D C[0][2] + C[1][0] + C[2][1] C[0][2] + C[1][0] + C[2][1] C[0][2] C[0] C 0 2 C[1][0] C[1] C 1 0 C[2][1] C[2] C 2 1 D == C[0][2] + C[1][1] + C[2][0] D C[0][2] + C[1][1] + C[2][0] C[0][2] + C[1][1] + C[2][0] C[0][2] C[0] C 0 2 C[1][1] C[1] C 1 1 C[2][0] C[2] C 2 0 D == C[0][1] + C[1][0] + C[2][2] D C[0][1] + C[1][0] + C[2][2] C[0][1] + C[1][0] + C[2][2] C[0][1] C[0] C 0 1 C[1][0] C[1] C 1 0 C[2][2] C[2] C 2 2 D == C[0][0] + C[1][2] + C[2][1] D C[0][0] + C[1][2] + C[2][1] C[0][0] + C[1][2] + C[2][1] C[0][0] C[0] C 0 0 C[1][2] C[1] C 1 2 C[2][1] C[2] C 2 1 {
			   	result = true;
			   } result = true result true System.out.println( result ? "Yes" : "No") System.out.println System.out System System.out result ? "Yes" : "No" result "Yes" "No" String[] args args
import java.util.*;

class Main{
	
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		
		int C[][] = new int[3][3];
		
		int sum = 0;
		
		for(int i = 0 ; i < 3 ; i ++){
			for(int j = 0 ; j < 3 ; j ++){
				C[i][j] = sc.nextInt();
				sum = sum + C[i][j] ;
			}
		}
		
		boolean result = false;
		
//		System.out.println(sum);
		
		if(sum % 3 == 0){
			
			int D = sum / 3;
			if(D == C[0][0] + C[1][1] + C[2][2] &&
			   D == C[0][1] + C[1][2] + C[2][0] &&
			   D == C[0][2] + C[1][0] + C[2][1] &&
			   D == C[0][2] + C[1][1] + C[2][0] &&
			   D == C[0][1] + C[1][0] + C[2][2] &&
			   D == C[0][0] + C[1][2] + C[2][1] ){
			   	result = true;
			   }
		}
		
		System.out.println( result ? "Yes" : "No");
	}
}


