import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //int N = sc.nextInt();
        int[][] c = new int[4][4];
        for(int row=1;row<=3;row++){
            for(int col=1;col<=3;col++){
                c[row][col]=sc.nextInt();
            }
        }
        String ans = "Yes";
        for(int col=2;col<=3;col++){
            int cur = c[1][1]-c[1][col];
            int d1 = c[2][1]-c[2][col];
            int d2 = c[3][1]-c[3][col];
            if(cur!=d1||cur!=d2)  ans  = "No";
        }
        if(!(c[1][2]-c[1][3]==c[2][2]-c[2][3]&&c[1][2]-c[1][3]==c[3][2]-c[3][3])) ans = "No";

        for(int row=2;row<=3;row++){
            int cur = c[1][1]-c[row][1];
            int d1 = c[1][2]-c[row][2];
            int d2 = c[1][3]-c[row][3];
            if(cur!=d1||cur!=d2)  ans  = "No";
        }
        if(!(c[2][1]-c[3][1]==c[2][2]-c[3][2]&&c[2][1]-c[3][1]==c[2][3]-c[3][3])) ans = "No";


        System.out.println(ans);


    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //int N = sc.nextInt();
        int[][] c = new int[4][4];
        for(int row=1;row<=3;row++){
            for(int col=1;col<=3;col++){
                c[row][col]=sc.nextInt();
            }
        }
        String ans = "Yes";
        for(int col=2;col<=3;col++){
            int cur = c[1][1]-c[1][col];
            int d1 = c[2][1]-c[2][col];
            int d2 = c[3][1]-c[3][col];
            if(cur!=d1||cur!=d2)  ans  = "No";
        }
        if(!(c[1][2]-c[1][3]==c[2][2]-c[2][3]&&c[1][2]-c[1][3]==c[3][2]-c[3][3])) ans = "No";

        for(int row=2;row<=3;row++){
            int cur = c[1][1]-c[row][1];
            int d1 = c[1][2]-c[row][2];
            int d2 = c[1][3]-c[row][3];
            if(cur!=d1||cur!=d2)  ans  = "No";
        }
        if(!(c[2][1]-c[3][1]==c[2][2]-c[3][2]&&c[2][1]-c[3][1]==c[2][3]-c[3][3])) ans = "No";


        System.out.println(ans);


    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //int N = sc.nextInt();
        int[][] c = new int[4][4];
        for(int row=1;row<=3;row++){
            for(int col=1;col<=3;col++){
                c[row][col]=sc.nextInt();
            }
        }
        String ans = "Yes";
        for(int col=2;col<=3;col++){
            int cur = c[1][1]-c[1][col];
            int d1 = c[2][1]-c[2][col];
            int d2 = c[3][1]-c[3][col];
            if(cur!=d1||cur!=d2)  ans  = "No";
        }
        if(!(c[1][2]-c[1][3]==c[2][2]-c[2][3]&&c[1][2]-c[1][3]==c[3][2]-c[3][3])) ans = "No";

        for(int row=2;row<=3;row++){
            int cur = c[1][1]-c[row][1];
            int d1 = c[1][2]-c[row][2];
            int d2 = c[1][3]-c[row][3];
            if(cur!=d1||cur!=d2)  ans  = "No";
        }
        if(!(c[2][1]-c[3][1]==c[2][2]-c[3][2]&&c[2][1]-c[3][1]==c[2][3]-c[3][3])) ans = "No";


        System.out.println(ans);


    } main {
        Scanner sc = new Scanner(System.in);
        //int N = sc.nextInt();
        int[][] c = new int[4][4];
        for(int row=1;row<=3;row++){
            for(int col=1;col<=3;col++){
                c[row][col]=sc.nextInt();
            }
        }
        String ans = "Yes";
        for(int col=2;col<=3;col++){
            int cur = c[1][1]-c[1][col];
            int d1 = c[2][1]-c[2][col];
            int d2 = c[3][1]-c[3][col];
            if(cur!=d1||cur!=d2)  ans  = "No";
        }
        if(!(c[1][2]-c[1][3]==c[2][2]-c[2][3]&&c[1][2]-c[1][3]==c[3][2]-c[3][3])) ans = "No";

        for(int row=2;row<=3;row++){
            int cur = c[1][1]-c[row][1];
            int d1 = c[1][2]-c[row][2];
            int d2 = c[1][3]-c[row][3];
            if(cur!=d1||cur!=d2)  ans  = "No";
        }
        if(!(c[2][1]-c[3][1]==c[2][2]-c[3][2]&&c[2][1]-c[3][1]==c[2][3]-c[3][3])) ans = "No";


        System.out.println(ans);


    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[][] c = new int[4][4]; c new int[4][4] 4 4 for(int row=1;row<=3;row++){
            for(int col=1;col<=3;col++){
                c[row][col]=sc.nextInt();
            }
        } int row=1; int row=1; row 1 row<=3 row 3 row++ row++ row {
            for(int col=1;col<=3;col++){
                c[row][col]=sc.nextInt();
            }
        } {
            for(int col=1;col<=3;col++){
                c[row][col]=sc.nextInt();
            }
        } for(int col=1;col<=3;col++){
                c[row][col]=sc.nextInt();
            } int col=1; int col=1; col 1 col<=3 col 3 col++ col++ col {
                c[row][col]=sc.nextInt();
            } {
                c[row][col]=sc.nextInt();
            } c[row][col]=sc.nextInt() c[row][col] c[row] c row col sc.nextInt() sc.nextInt sc String ans = "Yes"; ans "Yes" for(int col=2;col<=3;col++){
            int cur = c[1][1]-c[1][col];
            int d1 = c[2][1]-c[2][col];
            int d2 = c[3][1]-c[3][col];
            if(cur!=d1||cur!=d2)  ans  = "No";
        } int col=2; int col=2; col 2 col<=3 col 3 col++ col++ col {
            int cur = c[1][1]-c[1][col];
            int d1 = c[2][1]-c[2][col];
            int d2 = c[3][1]-c[3][col];
            if(cur!=d1||cur!=d2)  ans  = "No";
        } {
            int cur = c[1][1]-c[1][col];
            int d1 = c[2][1]-c[2][col];
            int d2 = c[3][1]-c[3][col];
            if(cur!=d1||cur!=d2)  ans  = "No";
        } int cur = c[1][1]-c[1][col]; cur c[1][1]-c[1][col] c[1][1] c[1] c 1 1 c[1][col] c[1] c 1 col int d1 = c[2][1]-c[2][col]; d1 c[2][1]-c[2][col] c[2][1] c[2] c 2 1 c[2][col] c[2] c 2 col int d2 = c[3][1]-c[3][col]; d2 c[3][1]-c[3][col] c[3][1] c[3] c 3 1 c[3][col] c[3] c 3 col if(cur!=d1||cur!=d2)  ans  = "No"; cur!=d1||cur!=d2 cur!=d1 cur d1 cur!=d2 cur d2 ans  = "No" ans "No" if(!(c[1][2]-c[1][3]==c[2][2]-c[2][3]&&c[1][2]-c[1][3]==c[3][2]-c[3][3])) ans = "No"; !(c[1][2]-c[1][3]==c[2][2]-c[2][3]&&c[1][2]-c[1][3]==c[3][2]-c[3][3]) (c[1][2]-c[1][3]==c[2][2]-c[2][3]&&c[1][2]-c[1][3]==c[3][2]-c[3][3]) c[1][2]-c[1][3]==c[2][2]-c[2][3] c[1][2]-c[1][3] c[1][2] c[1] c 1 2 c[1][3] c[1] c 1 3 c[2][2]-c[2][3] c[2][2] c[2] c 2 2 c[2][3] c[2] c 2 3 c[1][2]-c[1][3]==c[3][2]-c[3][3] c[1][2]-c[1][3] c[1][2] c[1] c 1 2 c[1][3] c[1] c 1 3 c[3][2]-c[3][3] c[3][2] c[3] c 3 2 c[3][3] c[3] c 3 3 ans = "No" ans "No" for(int row=2;row<=3;row++){
            int cur = c[1][1]-c[row][1];
            int d1 = c[1][2]-c[row][2];
            int d2 = c[1][3]-c[row][3];
            if(cur!=d1||cur!=d2)  ans  = "No";
        } int row=2; int row=2; row 2 row<=3 row 3 row++ row++ row {
            int cur = c[1][1]-c[row][1];
            int d1 = c[1][2]-c[row][2];
            int d2 = c[1][3]-c[row][3];
            if(cur!=d1||cur!=d2)  ans  = "No";
        } {
            int cur = c[1][1]-c[row][1];
            int d1 = c[1][2]-c[row][2];
            int d2 = c[1][3]-c[row][3];
            if(cur!=d1||cur!=d2)  ans  = "No";
        } int cur = c[1][1]-c[row][1]; cur c[1][1]-c[row][1] c[1][1] c[1] c 1 1 c[row][1] c[row] c row 1 int d1 = c[1][2]-c[row][2]; d1 c[1][2]-c[row][2] c[1][2] c[1] c 1 2 c[row][2] c[row] c row 2 int d2 = c[1][3]-c[row][3]; d2 c[1][3]-c[row][3] c[1][3] c[1] c 1 3 c[row][3] c[row] c row 3 if(cur!=d1||cur!=d2)  ans  = "No"; cur!=d1||cur!=d2 cur!=d1 cur d1 cur!=d2 cur d2 ans  = "No" ans "No" if(!(c[2][1]-c[3][1]==c[2][2]-c[3][2]&&c[2][1]-c[3][1]==c[2][3]-c[3][3])) ans = "No"; !(c[2][1]-c[3][1]==c[2][2]-c[3][2]&&c[2][1]-c[3][1]==c[2][3]-c[3][3]) (c[2][1]-c[3][1]==c[2][2]-c[3][2]&&c[2][1]-c[3][1]==c[2][3]-c[3][3]) c[2][1]-c[3][1]==c[2][2]-c[3][2] c[2][1]-c[3][1] c[2][1] c[2] c 2 1 c[3][1] c[3] c 3 1 c[2][2]-c[3][2] c[2][2] c[2] c 2 2 c[3][2] c[3] c 3 2 c[2][1]-c[3][1]==c[2][3]-c[3][3] c[2][1]-c[3][1] c[2][1] c[2] c 2 1 c[3][1] c[3] c 3 1 c[2][3]-c[3][3] c[2][3] c[2] c 2 3 c[3][3] c[3] c 3 3 ans = "No" ans "No" 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) {
        Scanner sc = new Scanner(System.in);
        //int N = sc.nextInt();
        int[][] c = new int[4][4];
        for(int row=1;row<=3;row++){
            for(int col=1;col<=3;col++){
                c[row][col]=sc.nextInt();
            }
        }
        String ans = "Yes";
        for(int col=2;col<=3;col++){
            int cur = c[1][1]-c[1][col];
            int d1 = c[2][1]-c[2][col];
            int d2 = c[3][1]-c[3][col];
            if(cur!=d1||cur!=d2)  ans  = "No";
        }
        if(!(c[1][2]-c[1][3]==c[2][2]-c[2][3]&&c[1][2]-c[1][3]==c[3][2]-c[3][3])) ans = "No";

        for(int row=2;row<=3;row++){
            int cur = c[1][1]-c[row][1];
            int d1 = c[1][2]-c[row][2];
            int d2 = c[1][3]-c[row][3];
            if(cur!=d1||cur!=d2)  ans  = "No";
        }
        if(!(c[2][1]-c[3][1]==c[2][2]-c[3][2]&&c[2][1]-c[3][1]==c[2][3]-c[3][3])) ans = "No";


        System.out.println(ans);


    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //int N = sc.nextInt();
        int[][] c = new int[4][4];
        for(int row=1;row<=3;row++){
            for(int col=1;col<=3;col++){
                c[row][col]=sc.nextInt();
            }
        }
        String ans = "Yes";
        for(int col=2;col<=3;col++){
            int cur = c[1][1]-c[1][col];
            int d1 = c[2][1]-c[2][col];
            int d2 = c[3][1]-c[3][col];
            if(cur!=d1||cur!=d2)  ans  = "No";
        }
        if(!(c[1][2]-c[1][3]==c[2][2]-c[2][3]&&c[1][2]-c[1][3]==c[3][2]-c[3][3])) ans = "No";

        for(int row=2;row<=3;row++){
            int cur = c[1][1]-c[row][1];
            int d1 = c[1][2]-c[row][2];
            int d2 = c[1][3]-c[row][3];
            if(cur!=d1||cur!=d2)  ans  = "No";
        }
        if(!(c[2][1]-c[3][1]==c[2][2]-c[3][2]&&c[2][1]-c[3][1]==c[2][3]-c[3][3])) ans = "No";


        System.out.println(ans);


    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //int N = sc.nextInt();
        int[][] c = new int[4][4];
        for(int row=1;row<=3;row++){
            for(int col=1;col<=3;col++){
                c[row][col]=sc.nextInt();
            }
        }
        String ans = "Yes";
        for(int col=2;col<=3;col++){
            int cur = c[1][1]-c[1][col];
            int d1 = c[2][1]-c[2][col];
            int d2 = c[3][1]-c[3][col];
            if(cur!=d1||cur!=d2)  ans  = "No";
        }
        if(!(c[1][2]-c[1][3]==c[2][2]-c[2][3]&&c[1][2]-c[1][3]==c[3][2]-c[3][3])) ans = "No";

        for(int row=2;row<=3;row++){
            int cur = c[1][1]-c[row][1];
            int d1 = c[1][2]-c[row][2];
            int d2 = c[1][3]-c[row][3];
            if(cur!=d1||cur!=d2)  ans  = "No";
        }
        if(!(c[2][1]-c[3][1]==c[2][2]-c[3][2]&&c[2][1]-c[3][1]==c[2][3]-c[3][3])) ans = "No";


        System.out.println(ans);


    }
}