import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        
        int grid[][] = new int[3][3];
        for(int i = 0; i < 3; i++ ){
            for(int j = 0; j < 3; j++){
                grid[i][j] = sc.nextInt();
            }
        }
        
        String ans = "No";
        for(int i = 0; i <= grid[0][0]; i++ ){
            int a0 = i;
            int b0 = grid[0][0] - a0;
            int a1 = grid[1][0] - b0;
            int a2 = grid[2][0] - b0;
            
            boolean isOK = true;
            for(int y = 1; y <3; y++ ){
                int by1 = grid[0][y] - a0;
                int by2 = grid[1][y] - a1;
                int by3 = grid[2][y] - a2;
                
                if( by1 < 0 || by2 < 0 || by3 < 0 ) {
                    isOK = false;
                    break;
                }
                if( by1 != by2 || by2 != by3 ) {
                    isOK = false;
                    break;
                }
            }
            
            if( isOK ) {
                ans = "Yes";
                break;
            }
        }
        System.out.println( ans );
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        
        int grid[][] = new int[3][3];
        for(int i = 0; i < 3; i++ ){
            for(int j = 0; j < 3; j++){
                grid[i][j] = sc.nextInt();
            }
        }
        
        String ans = "No";
        for(int i = 0; i <= grid[0][0]; i++ ){
            int a0 = i;
            int b0 = grid[0][0] - a0;
            int a1 = grid[1][0] - b0;
            int a2 = grid[2][0] - b0;
            
            boolean isOK = true;
            for(int y = 1; y <3; y++ ){
                int by1 = grid[0][y] - a0;
                int by2 = grid[1][y] - a1;
                int by3 = grid[2][y] - a2;
                
                if( by1 < 0 || by2 < 0 || by3 < 0 ) {
                    isOK = false;
                    break;
                }
                if( by1 != by2 || by2 != by3 ) {
                    isOK = false;
                    break;
                }
            }
            
            if( isOK ) {
                ans = "Yes";
                break;
            }
        }
        System.out.println( ans );
    }
} Main public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        
        int grid[][] = new int[3][3];
        for(int i = 0; i < 3; i++ ){
            for(int j = 0; j < 3; j++){
                grid[i][j] = sc.nextInt();
            }
        }
        
        String ans = "No";
        for(int i = 0; i <= grid[0][0]; i++ ){
            int a0 = i;
            int b0 = grid[0][0] - a0;
            int a1 = grid[1][0] - b0;
            int a2 = grid[2][0] - b0;
            
            boolean isOK = true;
            for(int y = 1; y <3; y++ ){
                int by1 = grid[0][y] - a0;
                int by2 = grid[1][y] - a1;
                int by3 = grid[2][y] - a2;
                
                if( by1 < 0 || by2 < 0 || by3 < 0 ) {
                    isOK = false;
                    break;
                }
                if( by1 != by2 || by2 != by3 ) {
                    isOK = false;
                    break;
                }
            }
            
            if( isOK ) {
                ans = "Yes";
                break;
            }
        }
        System.out.println( ans );
    } main {
        
        Scanner sc = new Scanner(System.in);
        
        int grid[][] = new int[3][3];
        for(int i = 0; i < 3; i++ ){
            for(int j = 0; j < 3; j++){
                grid[i][j] = sc.nextInt();
            }
        }
        
        String ans = "No";
        for(int i = 0; i <= grid[0][0]; i++ ){
            int a0 = i;
            int b0 = grid[0][0] - a0;
            int a1 = grid[1][0] - b0;
            int a2 = grid[2][0] - b0;
            
            boolean isOK = true;
            for(int y = 1; y <3; y++ ){
                int by1 = grid[0][y] - a0;
                int by2 = grid[1][y] - a1;
                int by3 = grid[2][y] - a2;
                
                if( by1 < 0 || by2 < 0 || by3 < 0 ) {
                    isOK = false;
                    break;
                }
                if( by1 != by2 || by2 != by3 ) {
                    isOK = false;
                    break;
                }
            }
            
            if( isOK ) {
                ans = "Yes";
                break;
            }
        }
        System.out.println( ans );
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int grid[][] = new int[3][3]; grid new int[3][3] 3 3 for(int i = 0; i < 3; i++ ){
            for(int j = 0; j < 3; j++){
                grid[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++){
                grid[i][j] = sc.nextInt();
            }
        } {
            for(int j = 0; j < 3; j++){
                grid[i][j] = sc.nextInt();
            }
        } for(int j = 0; j < 3; j++){
                grid[i][j] = sc.nextInt();
            } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
                grid[i][j] = sc.nextInt();
            } {
                grid[i][j] = sc.nextInt();
            } grid[i][j] = sc.nextInt() grid[i][j] grid[i] grid i j sc.nextInt() sc.nextInt sc String ans = "No"; ans "No" for(int i = 0; i <= grid[0][0]; i++ ){
            int a0 = i;
            int b0 = grid[0][0] - a0;
            int a1 = grid[1][0] - b0;
            int a2 = grid[2][0] - b0;
            
            boolean isOK = true;
            for(int y = 1; y <3; y++ ){
                int by1 = grid[0][y] - a0;
                int by2 = grid[1][y] - a1;
                int by3 = grid[2][y] - a2;
                
                if( by1 < 0 || by2 < 0 || by3 < 0 ) {
                    isOK = false;
                    break;
                }
                if( by1 != by2 || by2 != by3 ) {
                    isOK = false;
                    break;
                }
            }
            
            if( isOK ) {
                ans = "Yes";
                break;
            }
        } int i = 0; int i = 0; i 0 i <= grid[0][0] i grid[0][0] grid[0] grid 0 0 i++ i++ i {
            int a0 = i;
            int b0 = grid[0][0] - a0;
            int a1 = grid[1][0] - b0;
            int a2 = grid[2][0] - b0;
            
            boolean isOK = true;
            for(int y = 1; y <3; y++ ){
                int by1 = grid[0][y] - a0;
                int by2 = grid[1][y] - a1;
                int by3 = grid[2][y] - a2;
                
                if( by1 < 0 || by2 < 0 || by3 < 0 ) {
                    isOK = false;
                    break;
                }
                if( by1 != by2 || by2 != by3 ) {
                    isOK = false;
                    break;
                }
            }
            
            if( isOK ) {
                ans = "Yes";
                break;
            }
        } {
            int a0 = i;
            int b0 = grid[0][0] - a0;
            int a1 = grid[1][0] - b0;
            int a2 = grid[2][0] - b0;
            
            boolean isOK = true;
            for(int y = 1; y <3; y++ ){
                int by1 = grid[0][y] - a0;
                int by2 = grid[1][y] - a1;
                int by3 = grid[2][y] - a2;
                
                if( by1 < 0 || by2 < 0 || by3 < 0 ) {
                    isOK = false;
                    break;
                }
                if( by1 != by2 || by2 != by3 ) {
                    isOK = false;
                    break;
                }
            }
            
            if( isOK ) {
                ans = "Yes";
                break;
            }
        } int a0 = i; a0 i int b0 = grid[0][0] - a0; b0 grid[0][0] - a0 grid[0][0] grid[0] grid 0 0 a0 int a1 = grid[1][0] - b0; a1 grid[1][0] - b0 grid[1][0] grid[1] grid 1 0 b0 int a2 = grid[2][0] - b0; a2 grid[2][0] - b0 grid[2][0] grid[2] grid 2 0 b0 boolean isOK = true; isOK true for(int y = 1; y <3; y++ ){
                int by1 = grid[0][y] - a0;
                int by2 = grid[1][y] - a1;
                int by3 = grid[2][y] - a2;
                
                if( by1 < 0 || by2 < 0 || by3 < 0 ) {
                    isOK = false;
                    break;
                }
                if( by1 != by2 || by2 != by3 ) {
                    isOK = false;
                    break;
                }
            } int y = 1; int y = 1; y 1 y <3 y 3 y++ y++ y {
                int by1 = grid[0][y] - a0;
                int by2 = grid[1][y] - a1;
                int by3 = grid[2][y] - a2;
                
                if( by1 < 0 || by2 < 0 || by3 < 0 ) {
                    isOK = false;
                    break;
                }
                if( by1 != by2 || by2 != by3 ) {
                    isOK = false;
                    break;
                }
            } {
                int by1 = grid[0][y] - a0;
                int by2 = grid[1][y] - a1;
                int by3 = grid[2][y] - a2;
                
                if( by1 < 0 || by2 < 0 || by3 < 0 ) {
                    isOK = false;
                    break;
                }
                if( by1 != by2 || by2 != by3 ) {
                    isOK = false;
                    break;
                }
            } int by1 = grid[0][y] - a0; by1 grid[0][y] - a0 grid[0][y] grid[0] grid 0 y a0 int by2 = grid[1][y] - a1; by2 grid[1][y] - a1 grid[1][y] grid[1] grid 1 y a1 int by3 = grid[2][y] - a2; by3 grid[2][y] - a2 grid[2][y] grid[2] grid 2 y a2 if( by1 < 0 || by2 < 0 || by3 < 0 ) {
                    isOK = false;
                    break;
                } by1 < 0 || by2 < 0 || by3 < 0 by1 < 0 || by2 < 0 || by3 < 0 by1 < 0 by1 0 by2 < 0 by2 0 by3 < 0 by3 0 {
                    isOK = false;
                    break;
                } isOK = false isOK false break; if( by1 != by2 || by2 != by3 ) {
                    isOK = false;
                    break;
                } by1 != by2 || by2 != by3 by1 != by2 by1 by2 by2 != by3 by2 by3 {
                    isOK = false;
                    break;
                } isOK = false isOK false break; if( isOK ) {
                ans = "Yes";
                break;
            } isOK {
                ans = "Yes";
                break;
            } ans = "Yes" ans "Yes" break; System.out.println( ans ) System.out.println System.out System System.out ans String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        
        int grid[][] = new int[3][3];
        for(int i = 0; i < 3; i++ ){
            for(int j = 0; j < 3; j++){
                grid[i][j] = sc.nextInt();
            }
        }
        
        String ans = "No";
        for(int i = 0; i <= grid[0][0]; i++ ){
            int a0 = i;
            int b0 = grid[0][0] - a0;
            int a1 = grid[1][0] - b0;
            int a2 = grid[2][0] - b0;
            
            boolean isOK = true;
            for(int y = 1; y <3; y++ ){
                int by1 = grid[0][y] - a0;
                int by2 = grid[1][y] - a1;
                int by3 = grid[2][y] - a2;
                
                if( by1 < 0 || by2 < 0 || by3 < 0 ) {
                    isOK = false;
                    break;
                }
                if( by1 != by2 || by2 != by3 ) {
                    isOK = false;
                    break;
                }
            }
            
            if( isOK ) {
                ans = "Yes";
                break;
            }
        }
        System.out.println( ans );
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        
        int grid[][] = new int[3][3];
        for(int i = 0; i < 3; i++ ){
            for(int j = 0; j < 3; j++){
                grid[i][j] = sc.nextInt();
            }
        }
        
        String ans = "No";
        for(int i = 0; i <= grid[0][0]; i++ ){
            int a0 = i;
            int b0 = grid[0][0] - a0;
            int a1 = grid[1][0] - b0;
            int a2 = grid[2][0] - b0;
            
            boolean isOK = true;
            for(int y = 1; y <3; y++ ){
                int by1 = grid[0][y] - a0;
                int by2 = grid[1][y] - a1;
                int by3 = grid[2][y] - a2;
                
                if( by1 < 0 || by2 < 0 || by3 < 0 ) {
                    isOK = false;
                    break;
                }
                if( by1 != by2 || by2 != by3 ) {
                    isOK = false;
                    break;
                }
            }
            
            if( isOK ) {
                ans = "Yes";
                break;
            }
        }
        System.out.println( ans );
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        
        int grid[][] = new int[3][3];
        for(int i = 0; i < 3; i++ ){
            for(int j = 0; j < 3; j++){
                grid[i][j] = sc.nextInt();
            }
        }
        
        String ans = "No";
        for(int i = 0; i <= grid[0][0]; i++ ){
            int a0 = i;
            int b0 = grid[0][0] - a0;
            int a1 = grid[1][0] - b0;
            int a2 = grid[2][0] - b0;
            
            boolean isOK = true;
            for(int y = 1; y <3; y++ ){
                int by1 = grid[0][y] - a0;
                int by2 = grid[1][y] - a1;
                int by3 = grid[2][y] - a2;
                
                if( by1 < 0 || by2 < 0 || by3 < 0 ) {
                    isOK = false;
                    break;
                }
                if( by1 != by2 || by2 != by3 ) {
                    isOK = false;
                    break;
                }
            }
            
            if( isOK ) {
                ans = "Yes";
                break;
            }
        }
        System.out.println( ans );
    }
}
