import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int [][] List = new int[3][3];
        int a[]=new int[3];
        int b[]=new int[3];
        
        for(int i=0;i<3;i++){
            
            for(int j=0;j<3;j++){
                List[i][j] =sc.nextInt();
                
            }
        }
        a[0]=0;
        for(int i=0; i<3; i++) {
            
            b[i] = List[0][i] - a[0];
        }
        for(int i=0; i<3; i++) {
        
            a[i] = List[i][0] - b[0];
        }
        
        
        for(int i=0; i<3; i++) {
           for(int j=0; j<3; j++) {
                if(List[i][j] != a[i]+b[j]) {
                    System.out.println("No");
                    return;
                }
            }
        }
        
        System.out.println("Yes");
        
        
    }       
    
        
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int [][] List = new int[3][3];
        int a[]=new int[3];
        int b[]=new int[3];
        
        for(int i=0;i<3;i++){
            
            for(int j=0;j<3;j++){
                List[i][j] =sc.nextInt();
                
            }
        }
        a[0]=0;
        for(int i=0; i<3; i++) {
            
            b[i] = List[0][i] - a[0];
        }
        for(int i=0; i<3; i++) {
        
            a[i] = List[i][0] - b[0];
        }
        
        
        for(int i=0; i<3; i++) {
           for(int j=0; j<3; j++) {
                if(List[i][j] != a[i]+b[j]) {
                    System.out.println("No");
                    return;
                }
            }
        }
        
        System.out.println("Yes");
        
        
    }       
    
        
} Main public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int [][] List = new int[3][3];
        int a[]=new int[3];
        int b[]=new int[3];
        
        for(int i=0;i<3;i++){
            
            for(int j=0;j<3;j++){
                List[i][j] =sc.nextInt();
                
            }
        }
        a[0]=0;
        for(int i=0; i<3; i++) {
            
            b[i] = List[0][i] - a[0];
        }
        for(int i=0; i<3; i++) {
        
            a[i] = List[i][0] - b[0];
        }
        
        
        for(int i=0; i<3; i++) {
           for(int j=0; j<3; j++) {
                if(List[i][j] != a[i]+b[j]) {
                    System.out.println("No");
                    return;
                }
            }
        }
        
        System.out.println("Yes");
        
        
    } main {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int [][] List = new int[3][3];
        int a[]=new int[3];
        int b[]=new int[3];
        
        for(int i=0;i<3;i++){
            
            for(int j=0;j<3;j++){
                List[i][j] =sc.nextInt();
                
            }
        }
        a[0]=0;
        for(int i=0; i<3; i++) {
            
            b[i] = List[0][i] - a[0];
        }
        for(int i=0; i<3; i++) {
        
            a[i] = List[i][0] - b[0];
        }
        
        
        for(int i=0; i<3; i++) {
           for(int j=0; j<3; j++) {
                if(List[i][j] != a[i]+b[j]) {
                    System.out.println("No");
                    return;
                }
            }
        }
        
        System.out.println("Yes");
        
        
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int [][] List = new int[3][3]; List new int[3][3] 3 3 int a[]=new int[3]; a new int[3] 3 int b[]=new int[3]; b new int[3] 3 for(int i=0;i<3;i++){
            
            for(int j=0;j<3;j++){
                List[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++){
                List[i][j] =sc.nextInt();
                
            }
        } {
            
            for(int j=0;j<3;j++){
                List[i][j] =sc.nextInt();
                
            }
        } for(int j=0;j<3;j++){
                List[i][j] =sc.nextInt();
                
            } int j=0; int j=0; j 0 j<3 j 3 j++ j++ j {
                List[i][j] =sc.nextInt();
                
            } {
                List[i][j] =sc.nextInt();
                
            } List[i][j] =sc.nextInt() List[i][j] List[i] List i j sc.nextInt() sc.nextInt sc a[0]=0 a[0] a 0 0 for(int i=0; i<3; i++) {
            
            b[i] = List[0][i] - a[0];
        } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
            
            b[i] = List[0][i] - a[0];
        } {
            
            b[i] = List[0][i] - a[0];
        } b[i] = List[0][i] - a[0] b[i] b i List[0][i] - a[0] List[0][i] List[0] List 0 i a[0] a 0 for(int i=0; i<3; i++) {
        
            a[i] = List[i][0] - b[0];
        } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
        
            a[i] = List[i][0] - b[0];
        } {
        
            a[i] = List[i][0] - b[0];
        } a[i] = List[i][0] - b[0] a[i] a i List[i][0] - b[0] List[i][0] List[i] List i 0 b[0] b 0 for(int i=0; i<3; i++) {
           for(int j=0; j<3; j++) {
                if(List[i][j] != a[i]+b[j]) {
                    System.out.println("No");
                    return;
                }
            }
        } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
           for(int j=0; j<3; j++) {
                if(List[i][j] != a[i]+b[j]) {
                    System.out.println("No");
                    return;
                }
            }
        } {
           for(int j=0; j<3; j++) {
                if(List[i][j] != a[i]+b[j]) {
                    System.out.println("No");
                    return;
                }
            }
        } for(int j=0; j<3; j++) {
                if(List[i][j] != a[i]+b[j]) {
                    System.out.println("No");
                    return;
                }
            } int j=0; int j=0; j 0 j<3 j 3 j++ j++ j {
                if(List[i][j] != a[i]+b[j]) {
                    System.out.println("No");
                    return;
                }
            } {
                if(List[i][j] != a[i]+b[j]) {
                    System.out.println("No");
                    return;
                }
            } if(List[i][j] != a[i]+b[j]) {
                    System.out.println("No");
                    return;
                } List[i][j] != a[i]+b[j] List[i][j] List[i] List i j a[i]+b[j] a[i] a i b[j] b j {
                    System.out.println("No");
                    return;
                } System.out.println("No") System.out.println System.out System System.out "No" return; System.out.println("Yes") System.out.println System.out System System.out "Yes" String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int [][] List = new int[3][3];
        int a[]=new int[3];
        int b[]=new int[3];
        
        for(int i=0;i<3;i++){
            
            for(int j=0;j<3;j++){
                List[i][j] =sc.nextInt();
                
            }
        }
        a[0]=0;
        for(int i=0; i<3; i++) {
            
            b[i] = List[0][i] - a[0];
        }
        for(int i=0; i<3; i++) {
        
            a[i] = List[i][0] - b[0];
        }
        
        
        for(int i=0; i<3; i++) {
           for(int j=0; j<3; j++) {
                if(List[i][j] != a[i]+b[j]) {
                    System.out.println("No");
                    return;
                }
            }
        }
        
        System.out.println("Yes");
        
        
    }       
    
        
} public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int [][] List = new int[3][3];
        int a[]=new int[3];
        int b[]=new int[3];
        
        for(int i=0;i<3;i++){
            
            for(int j=0;j<3;j++){
                List[i][j] =sc.nextInt();
                
            }
        }
        a[0]=0;
        for(int i=0; i<3; i++) {
            
            b[i] = List[0][i] - a[0];
        }
        for(int i=0; i<3; i++) {
        
            a[i] = List[i][0] - b[0];
        }
        
        
        for(int i=0; i<3; i++) {
           for(int j=0; j<3; j++) {
                if(List[i][j] != a[i]+b[j]) {
                    System.out.println("No");
                    return;
                }
            }
        }
        
        System.out.println("Yes");
        
        
    }       
    
        
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int [][] List = new int[3][3];
        int a[]=new int[3];
        int b[]=new int[3];
        
        for(int i=0;i<3;i++){
            
            for(int j=0;j<3;j++){
                List[i][j] =sc.nextInt();
                
            }
        }
        a[0]=0;
        for(int i=0; i<3; i++) {
            
            b[i] = List[0][i] - a[0];
        }
        for(int i=0; i<3; i++) {
        
            a[i] = List[i][0] - b[0];
        }
        
        
        for(int i=0; i<3; i++) {
           for(int j=0; j<3; j++) {
                if(List[i][j] != a[i]+b[j]) {
                    System.out.println("No");
                    return;
                }
            }
        }
        
        System.out.println("Yes");
        
        
    }       
    
        
}
