import java.util.Scanner;
import java.util.Arrays;
import java.util.ArrayList;

class Main{
	public static void main(String[] args){
      	Scanner sc = new Scanner(System.in);
      	int a[][] = new int[3][3];
      	for(int i = 0; i < 3; i++)
          for(int j = 0; j < 3; j++)
            a[i][j] = sc.nextInt();
      
      	boolean flag = true;
      	for(int i = 0; i < 2; i++){
      		if((a[0][i] - a[0][i+1] != a[1][i] - a[1][i+1] || a[1][i] - a[1][i+1] != a[2][i] -a[2][i+1])) 
              flag = false;
    	}
      	for(int i = 0; i < 2; i++){
      		if((a[i][0] - a[i+1][0] != a[i][1] - a[i+1][1] || a[i][1] - a[i+1][1] != a[i][2] -a[i+1][2])) 
              flag = false;
    	}
      
      	if(flag)
          System.out.println("Yes");
      	else
          System.out.println("No");
    }
  
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util import java.util.ArrayList; ArrayList java.util class Main{
	public static void main(String[] args){
      	Scanner sc = new Scanner(System.in);
      	int a[][] = new int[3][3];
      	for(int i = 0; i < 3; i++)
          for(int j = 0; j < 3; j++)
            a[i][j] = sc.nextInt();
      
      	boolean flag = true;
      	for(int i = 0; i < 2; i++){
      		if((a[0][i] - a[0][i+1] != a[1][i] - a[1][i+1] || a[1][i] - a[1][i+1] != a[2][i] -a[2][i+1])) 
              flag = false;
    	}
      	for(int i = 0; i < 2; i++){
      		if((a[i][0] - a[i+1][0] != a[i][1] - a[i+1][1] || a[i][1] - a[i+1][1] != a[i][2] -a[i+1][2])) 
              flag = false;
    	}
      
      	if(flag)
          System.out.println("Yes");
      	else
          System.out.println("No");
    }
  
} Main public static void main(String[] args){
      	Scanner sc = new Scanner(System.in);
      	int a[][] = new int[3][3];
      	for(int i = 0; i < 3; i++)
          for(int j = 0; j < 3; j++)
            a[i][j] = sc.nextInt();
      
      	boolean flag = true;
      	for(int i = 0; i < 2; i++){
      		if((a[0][i] - a[0][i+1] != a[1][i] - a[1][i+1] || a[1][i] - a[1][i+1] != a[2][i] -a[2][i+1])) 
              flag = false;
    	}
      	for(int i = 0; i < 2; i++){
      		if((a[i][0] - a[i+1][0] != a[i][1] - a[i+1][1] || a[i][1] - a[i+1][1] != a[i][2] -a[i+1][2])) 
              flag = false;
    	}
      
      	if(flag)
          System.out.println("Yes");
      	else
          System.out.println("No");
    } main {
      	Scanner sc = new Scanner(System.in);
      	int a[][] = new int[3][3];
      	for(int i = 0; i < 3; i++)
          for(int j = 0; j < 3; j++)
            a[i][j] = sc.nextInt();
      
      	boolean flag = true;
      	for(int i = 0; i < 2; i++){
      		if((a[0][i] - a[0][i+1] != a[1][i] - a[1][i+1] || a[1][i] - a[1][i+1] != a[2][i] -a[2][i+1])) 
              flag = false;
    	}
      	for(int i = 0; i < 2; i++){
      		if((a[i][0] - a[i+1][0] != a[i][1] - a[i+1][1] || a[i][1] - a[i+1][1] != a[i][2] -a[i+1][2])) 
              flag = false;
    	}
      
      	if(flag)
          System.out.println("Yes");
      	else
          System.out.println("No");
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a[][] = new int[3][3]; a new int[3][3] 3 3 for(int i = 0; i < 3; i++)
          for(int j = 0; j < 3; j++)
            a[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++)
            a[i][j] = sc.nextInt(); for(int j = 0; j < 3; j++)
            a[i][j] = sc.nextInt(); int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j a[i][j] = sc.nextInt(); a[i][j] = sc.nextInt() a[i][j] a[i] a i j sc.nextInt() sc.nextInt sc boolean flag = true; flag true for(int i = 0; i < 2; i++){
      		if((a[0][i] - a[0][i+1] != a[1][i] - a[1][i+1] || a[1][i] - a[1][i+1] != a[2][i] -a[2][i+1])) 
              flag = false;
    	} int i = 0; int i = 0; i 0 i < 2 i 2 i++ i++ i {
      		if((a[0][i] - a[0][i+1] != a[1][i] - a[1][i+1] || a[1][i] - a[1][i+1] != a[2][i] -a[2][i+1])) 
              flag = false;
    	} {
      		if((a[0][i] - a[0][i+1] != a[1][i] - a[1][i+1] || a[1][i] - a[1][i+1] != a[2][i] -a[2][i+1])) 
              flag = false;
    	} if((a[0][i] - a[0][i+1] != a[1][i] - a[1][i+1] || a[1][i] - a[1][i+1] != a[2][i] -a[2][i+1])) 
              flag = false; (a[0][i] - a[0][i+1] != a[1][i] - a[1][i+1] || a[1][i] - a[1][i+1] != a[2][i] -a[2][i+1]) a[0][i] - a[0][i+1] != a[1][i] - a[1][i+1] a[0][i] - a[0][i+1] a[0][i] a[0] a 0 i a[0][i+1] a[0] a 0 i+1 i 1 a[1][i] - a[1][i+1] a[1][i] a[1] a 1 i a[1][i+1] a[1] a 1 i+1 i 1 a[1][i] - a[1][i+1] != a[2][i] -a[2][i+1] a[1][i] - a[1][i+1] a[1][i] a[1] a 1 i a[1][i+1] a[1] a 1 i+1 i 1 a[2][i] -a[2][i+1] a[2][i] a[2] a 2 i a[2][i+1] a[2] a 2 i+1 i 1 flag = false flag false for(int i = 0; i < 2; i++){
      		if((a[i][0] - a[i+1][0] != a[i][1] - a[i+1][1] || a[i][1] - a[i+1][1] != a[i][2] -a[i+1][2])) 
              flag = false;
    	} int i = 0; int i = 0; i 0 i < 2 i 2 i++ i++ i {
      		if((a[i][0] - a[i+1][0] != a[i][1] - a[i+1][1] || a[i][1] - a[i+1][1] != a[i][2] -a[i+1][2])) 
              flag = false;
    	} {
      		if((a[i][0] - a[i+1][0] != a[i][1] - a[i+1][1] || a[i][1] - a[i+1][1] != a[i][2] -a[i+1][2])) 
              flag = false;
    	} if((a[i][0] - a[i+1][0] != a[i][1] - a[i+1][1] || a[i][1] - a[i+1][1] != a[i][2] -a[i+1][2])) 
              flag = false; (a[i][0] - a[i+1][0] != a[i][1] - a[i+1][1] || a[i][1] - a[i+1][1] != a[i][2] -a[i+1][2]) a[i][0] - a[i+1][0] != a[i][1] - a[i+1][1] a[i][0] - a[i+1][0] a[i][0] a[i] a i 0 a[i+1][0] a[i+1] a i+1 i 1 0 a[i][1] - a[i+1][1] a[i][1] a[i] a i 1 a[i+1][1] a[i+1] a i+1 i 1 1 a[i][1] - a[i+1][1] != a[i][2] -a[i+1][2] a[i][1] - a[i+1][1] a[i][1] a[i] a i 1 a[i+1][1] a[i+1] a i+1 i 1 1 a[i][2] -a[i+1][2] a[i][2] a[i] a i 2 a[i+1][2] a[i+1] a i+1 i 1 2 flag = false flag false if(flag)
          System.out.println("Yes");
      	else
          System.out.println("No"); flag System.out.println("Yes") System.out.println System.out System System.out "Yes" System.out.println("No") System.out.println System.out System System.out "No" String[] args args
import java.util.Scanner;
import java.util.Arrays;
import java.util.ArrayList;

class Main{
	public static void main(String[] args){
      	Scanner sc = new Scanner(System.in);
      	int a[][] = new int[3][3];
      	for(int i = 0; i < 3; i++)
          for(int j = 0; j < 3; j++)
            a[i][j] = sc.nextInt();
      
      	boolean flag = true;
      	for(int i = 0; i < 2; i++){
      		if((a[0][i] - a[0][i+1] != a[1][i] - a[1][i+1] || a[1][i] - a[1][i+1] != a[2][i] -a[2][i+1])) 
              flag = false;
    	}
      	for(int i = 0; i < 2; i++){
      		if((a[i][0] - a[i+1][0] != a[i][1] - a[i+1][1] || a[i][1] - a[i+1][1] != a[i][2] -a[i+1][2])) 
              flag = false;
    	}
      
      	if(flag)
          System.out.println("Yes");
      	else
          System.out.println("No");
    }
  
}