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

public class Main {

public static void main(String [] args){


        int H,W,D;
        int count =0;
        Scanner input = new Scanner(System.in);
        String Ans = "Yes";
        int [][] arr = new int[4][4];

        for (int i=1; i<=3; i++ ) {
                for (int j=1; j<=3; j++ ) {
                        arr[i][j] = input.nextInt();
                }
        }

        if (arr[1][1]-arr[2][1] != arr[1][2]-arr[2][2] || arr[1][2]-arr[2][2] != arr[1][3]-arr[2][3]) {
                //a1 - a2
                Ans = "No";
        }else if (arr[2][1]-arr[3][1] != arr[2][2]-arr[3][2] || arr[2][2]-arr[3][2] != arr[2][3]-arr[3][3]) {
                //a2 - a3
                Ans = "No";
        }else if (arr[3][1]-arr[1][1] != arr[3][2]-arr[1][2] || arr[3][2]-arr[1][2] != arr[3][3]-arr[1][3]) {
                //a3 - a1
                Ans = "No";
        }else if (arr[1][1]-arr[1][2] != arr[2][1]-arr[2][2] || arr[2][1]-arr[2][2] != arr[3][1]-arr[3][2]) {
                //b1 - b2
                Ans = "No";
        }else if (arr[1][2]-arr[1][3] != arr[2][2]-arr[2][3] || arr[2][2]-arr[2][3] != arr[3][2]-arr[3][3]) {
                //b2 - b3
                Ans = "No";
        }else if (arr[1][3]-arr[1][1] != arr[2][3]-arr[2][1] || arr[2][3]-arr[2][1] != arr[3][3]-arr[3][1]) {
                //b3 - b1
                Ans = "No";
        }

        System.out.println(Ans);
}
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util public class Main {

public static void main(String [] args){


        int H,W,D;
        int count =0;
        Scanner input = new Scanner(System.in);
        String Ans = "Yes";
        int [][] arr = new int[4][4];

        for (int i=1; i<=3; i++ ) {
                for (int j=1; j<=3; j++ ) {
                        arr[i][j] = input.nextInt();
                }
        }

        if (arr[1][1]-arr[2][1] != arr[1][2]-arr[2][2] || arr[1][2]-arr[2][2] != arr[1][3]-arr[2][3]) {
                //a1 - a2
                Ans = "No";
        }else if (arr[2][1]-arr[3][1] != arr[2][2]-arr[3][2] || arr[2][2]-arr[3][2] != arr[2][3]-arr[3][3]) {
                //a2 - a3
                Ans = "No";
        }else if (arr[3][1]-arr[1][1] != arr[3][2]-arr[1][2] || arr[3][2]-arr[1][2] != arr[3][3]-arr[1][3]) {
                //a3 - a1
                Ans = "No";
        }else if (arr[1][1]-arr[1][2] != arr[2][1]-arr[2][2] || arr[2][1]-arr[2][2] != arr[3][1]-arr[3][2]) {
                //b1 - b2
                Ans = "No";
        }else if (arr[1][2]-arr[1][3] != arr[2][2]-arr[2][3] || arr[2][2]-arr[2][3] != arr[3][2]-arr[3][3]) {
                //b2 - b3
                Ans = "No";
        }else if (arr[1][3]-arr[1][1] != arr[2][3]-arr[2][1] || arr[2][3]-arr[2][1] != arr[3][3]-arr[3][1]) {
                //b3 - b1
                Ans = "No";
        }

        System.out.println(Ans);
}
} Main public static void main(String [] args){


        int H,W,D;
        int count =0;
        Scanner input = new Scanner(System.in);
        String Ans = "Yes";
        int [][] arr = new int[4][4];

        for (int i=1; i<=3; i++ ) {
                for (int j=1; j<=3; j++ ) {
                        arr[i][j] = input.nextInt();
                }
        }

        if (arr[1][1]-arr[2][1] != arr[1][2]-arr[2][2] || arr[1][2]-arr[2][2] != arr[1][3]-arr[2][3]) {
                //a1 - a2
                Ans = "No";
        }else if (arr[2][1]-arr[3][1] != arr[2][2]-arr[3][2] || arr[2][2]-arr[3][2] != arr[2][3]-arr[3][3]) {
                //a2 - a3
                Ans = "No";
        }else if (arr[3][1]-arr[1][1] != arr[3][2]-arr[1][2] || arr[3][2]-arr[1][2] != arr[3][3]-arr[1][3]) {
                //a3 - a1
                Ans = "No";
        }else if (arr[1][1]-arr[1][2] != arr[2][1]-arr[2][2] || arr[2][1]-arr[2][2] != arr[3][1]-arr[3][2]) {
                //b1 - b2
                Ans = "No";
        }else if (arr[1][2]-arr[1][3] != arr[2][2]-arr[2][3] || arr[2][2]-arr[2][3] != arr[3][2]-arr[3][3]) {
                //b2 - b3
                Ans = "No";
        }else if (arr[1][3]-arr[1][1] != arr[2][3]-arr[2][1] || arr[2][3]-arr[2][1] != arr[3][3]-arr[3][1]) {
                //b3 - b1
                Ans = "No";
        }

        System.out.println(Ans);
} main {


        int H,W,D;
        int count =0;
        Scanner input = new Scanner(System.in);
        String Ans = "Yes";
        int [][] arr = new int[4][4];

        for (int i=1; i<=3; i++ ) {
                for (int j=1; j<=3; j++ ) {
                        arr[i][j] = input.nextInt();
                }
        }

        if (arr[1][1]-arr[2][1] != arr[1][2]-arr[2][2] || arr[1][2]-arr[2][2] != arr[1][3]-arr[2][3]) {
                //a1 - a2
                Ans = "No";
        }else if (arr[2][1]-arr[3][1] != arr[2][2]-arr[3][2] || arr[2][2]-arr[3][2] != arr[2][3]-arr[3][3]) {
                //a2 - a3
                Ans = "No";
        }else if (arr[3][1]-arr[1][1] != arr[3][2]-arr[1][2] || arr[3][2]-arr[1][2] != arr[3][3]-arr[1][3]) {
                //a3 - a1
                Ans = "No";
        }else if (arr[1][1]-arr[1][2] != arr[2][1]-arr[2][2] || arr[2][1]-arr[2][2] != arr[3][1]-arr[3][2]) {
                //b1 - b2
                Ans = "No";
        }else if (arr[1][2]-arr[1][3] != arr[2][2]-arr[2][3] || arr[2][2]-arr[2][3] != arr[3][2]-arr[3][3]) {
                //b2 - b3
                Ans = "No";
        }else if (arr[1][3]-arr[1][1] != arr[2][3]-arr[2][1] || arr[2][3]-arr[2][1] != arr[3][3]-arr[3][1]) {
                //b3 - b1
                Ans = "No";
        }

        System.out.println(Ans);
} int H H W W D; D int count =0; count 0 Scanner input = new Scanner(System.in); input new Scanner(System.in) String Ans = "Yes"; Ans "Yes" int [][] arr = new int[4][4]; arr new int[4][4] 4 4 for (int i=1; i<=3; i++ ) {
                for (int j=1; j<=3; j++ ) {
                        arr[i][j] = input.nextInt();
                }
        } int i=1; int i=1; i 1 i<=3 i 3 i++ i++ i {
                for (int j=1; j<=3; j++ ) {
                        arr[i][j] = input.nextInt();
                }
        } {
                for (int j=1; j<=3; j++ ) {
                        arr[i][j] = input.nextInt();
                }
        } for (int j=1; j<=3; j++ ) {
                        arr[i][j] = input.nextInt();
                } int j=1; int j=1; j 1 j<=3 j 3 j++ j++ j {
                        arr[i][j] = input.nextInt();
                } {
                        arr[i][j] = input.nextInt();
                } arr[i][j] = input.nextInt() arr[i][j] arr[i] arr i j input.nextInt() input.nextInt input if (arr[1][1]-arr[2][1] != arr[1][2]-arr[2][2] || arr[1][2]-arr[2][2] != arr[1][3]-arr[2][3]) {
                //a1 - a2
                Ans = "No";
        }else if (arr[2][1]-arr[3][1] != arr[2][2]-arr[3][2] || arr[2][2]-arr[3][2] != arr[2][3]-arr[3][3]) {
                //a2 - a3
                Ans = "No";
        }else if (arr[3][1]-arr[1][1] != arr[3][2]-arr[1][2] || arr[3][2]-arr[1][2] != arr[3][3]-arr[1][3]) {
                //a3 - a1
                Ans = "No";
        }else if (arr[1][1]-arr[1][2] != arr[2][1]-arr[2][2] || arr[2][1]-arr[2][2] != arr[3][1]-arr[3][2]) {
                //b1 - b2
                Ans = "No";
        }else if (arr[1][2]-arr[1][3] != arr[2][2]-arr[2][3] || arr[2][2]-arr[2][3] != arr[3][2]-arr[3][3]) {
                //b2 - b3
                Ans = "No";
        }else if (arr[1][3]-arr[1][1] != arr[2][3]-arr[2][1] || arr[2][3]-arr[2][1] != arr[3][3]-arr[3][1]) {
                //b3 - b1
                Ans = "No";
        } arr[1][1]-arr[2][1] != arr[1][2]-arr[2][2] || arr[1][2]-arr[2][2] != arr[1][3]-arr[2][3] arr[1][1]-arr[2][1] != arr[1][2]-arr[2][2] arr[1][1]-arr[2][1] arr[1][1] arr[1] arr 1 1 arr[2][1] arr[2] arr 2 1 arr[1][2]-arr[2][2] arr[1][2] arr[1] arr 1 2 arr[2][2] arr[2] arr 2 2 arr[1][2]-arr[2][2] != arr[1][3]-arr[2][3] arr[1][2]-arr[2][2] arr[1][2] arr[1] arr 1 2 arr[2][2] arr[2] arr 2 2 arr[1][3]-arr[2][3] arr[1][3] arr[1] arr 1 3 arr[2][3] arr[2] arr 2 3 {
                //a1 - a2
                Ans = "No";
        } Ans = "No" Ans "No" if (arr[2][1]-arr[3][1] != arr[2][2]-arr[3][2] || arr[2][2]-arr[3][2] != arr[2][3]-arr[3][3]) {
                //a2 - a3
                Ans = "No";
        }else if (arr[3][1]-arr[1][1] != arr[3][2]-arr[1][2] || arr[3][2]-arr[1][2] != arr[3][3]-arr[1][3]) {
                //a3 - a1
                Ans = "No";
        }else if (arr[1][1]-arr[1][2] != arr[2][1]-arr[2][2] || arr[2][1]-arr[2][2] != arr[3][1]-arr[3][2]) {
                //b1 - b2
                Ans = "No";
        }else if (arr[1][2]-arr[1][3] != arr[2][2]-arr[2][3] || arr[2][2]-arr[2][3] != arr[3][2]-arr[3][3]) {
                //b2 - b3
                Ans = "No";
        }else if (arr[1][3]-arr[1][1] != arr[2][3]-arr[2][1] || arr[2][3]-arr[2][1] != arr[3][3]-arr[3][1]) {
                //b3 - b1
                Ans = "No";
        } arr[2][1]-arr[3][1] != arr[2][2]-arr[3][2] || arr[2][2]-arr[3][2] != arr[2][3]-arr[3][3] arr[2][1]-arr[3][1] != arr[2][2]-arr[3][2] arr[2][1]-arr[3][1] arr[2][1] arr[2] arr 2 1 arr[3][1] arr[3] arr 3 1 arr[2][2]-arr[3][2] arr[2][2] arr[2] arr 2 2 arr[3][2] arr[3] arr 3 2 arr[2][2]-arr[3][2] != arr[2][3]-arr[3][3] arr[2][2]-arr[3][2] arr[2][2] arr[2] arr 2 2 arr[3][2] arr[3] arr 3 2 arr[2][3]-arr[3][3] arr[2][3] arr[2] arr 2 3 arr[3][3] arr[3] arr 3 3 {
                //a2 - a3
                Ans = "No";
        } Ans = "No" Ans "No" if (arr[3][1]-arr[1][1] != arr[3][2]-arr[1][2] || arr[3][2]-arr[1][2] != arr[3][3]-arr[1][3]) {
                //a3 - a1
                Ans = "No";
        }else if (arr[1][1]-arr[1][2] != arr[2][1]-arr[2][2] || arr[2][1]-arr[2][2] != arr[3][1]-arr[3][2]) {
                //b1 - b2
                Ans = "No";
        }else if (arr[1][2]-arr[1][3] != arr[2][2]-arr[2][3] || arr[2][2]-arr[2][3] != arr[3][2]-arr[3][3]) {
                //b2 - b3
                Ans = "No";
        }else if (arr[1][3]-arr[1][1] != arr[2][3]-arr[2][1] || arr[2][3]-arr[2][1] != arr[3][3]-arr[3][1]) {
                //b3 - b1
                Ans = "No";
        } arr[3][1]-arr[1][1] != arr[3][2]-arr[1][2] || arr[3][2]-arr[1][2] != arr[3][3]-arr[1][3] arr[3][1]-arr[1][1] != arr[3][2]-arr[1][2] arr[3][1]-arr[1][1] arr[3][1] arr[3] arr 3 1 arr[1][1] arr[1] arr 1 1 arr[3][2]-arr[1][2] arr[3][2] arr[3] arr 3 2 arr[1][2] arr[1] arr 1 2 arr[3][2]-arr[1][2] != arr[3][3]-arr[1][3] arr[3][2]-arr[1][2] arr[3][2] arr[3] arr 3 2 arr[1][2] arr[1] arr 1 2 arr[3][3]-arr[1][3] arr[3][3] arr[3] arr 3 3 arr[1][3] arr[1] arr 1 3 {
                //a3 - a1
                Ans = "No";
        } Ans = "No" Ans "No" if (arr[1][1]-arr[1][2] != arr[2][1]-arr[2][2] || arr[2][1]-arr[2][2] != arr[3][1]-arr[3][2]) {
                //b1 - b2
                Ans = "No";
        }else if (arr[1][2]-arr[1][3] != arr[2][2]-arr[2][3] || arr[2][2]-arr[2][3] != arr[3][2]-arr[3][3]) {
                //b2 - b3
                Ans = "No";
        }else if (arr[1][3]-arr[1][1] != arr[2][3]-arr[2][1] || arr[2][3]-arr[2][1] != arr[3][3]-arr[3][1]) {
                //b3 - b1
                Ans = "No";
        } arr[1][1]-arr[1][2] != arr[2][1]-arr[2][2] || arr[2][1]-arr[2][2] != arr[3][1]-arr[3][2] arr[1][1]-arr[1][2] != arr[2][1]-arr[2][2] arr[1][1]-arr[1][2] arr[1][1] arr[1] arr 1 1 arr[1][2] arr[1] arr 1 2 arr[2][1]-arr[2][2] arr[2][1] arr[2] arr 2 1 arr[2][2] arr[2] arr 2 2 arr[2][1]-arr[2][2] != arr[3][1]-arr[3][2] arr[2][1]-arr[2][2] arr[2][1] arr[2] arr 2 1 arr[2][2] arr[2] arr 2 2 arr[3][1]-arr[3][2] arr[3][1] arr[3] arr 3 1 arr[3][2] arr[3] arr 3 2 {
                //b1 - b2
                Ans = "No";
        } Ans = "No" Ans "No" if (arr[1][2]-arr[1][3] != arr[2][2]-arr[2][3] || arr[2][2]-arr[2][3] != arr[3][2]-arr[3][3]) {
                //b2 - b3
                Ans = "No";
        }else if (arr[1][3]-arr[1][1] != arr[2][3]-arr[2][1] || arr[2][3]-arr[2][1] != arr[3][3]-arr[3][1]) {
                //b3 - b1
                Ans = "No";
        } arr[1][2]-arr[1][3] != arr[2][2]-arr[2][3] || arr[2][2]-arr[2][3] != arr[3][2]-arr[3][3] arr[1][2]-arr[1][3] != arr[2][2]-arr[2][3] arr[1][2]-arr[1][3] arr[1][2] arr[1] arr 1 2 arr[1][3] arr[1] arr 1 3 arr[2][2]-arr[2][3] arr[2][2] arr[2] arr 2 2 arr[2][3] arr[2] arr 2 3 arr[2][2]-arr[2][3] != arr[3][2]-arr[3][3] arr[2][2]-arr[2][3] arr[2][2] arr[2] arr 2 2 arr[2][3] arr[2] arr 2 3 arr[3][2]-arr[3][3] arr[3][2] arr[3] arr 3 2 arr[3][3] arr[3] arr 3 3 {
                //b2 - b3
                Ans = "No";
        } Ans = "No" Ans "No" if (arr[1][3]-arr[1][1] != arr[2][3]-arr[2][1] || arr[2][3]-arr[2][1] != arr[3][3]-arr[3][1]) {
                //b3 - b1
                Ans = "No";
        } arr[1][3]-arr[1][1] != arr[2][3]-arr[2][1] || arr[2][3]-arr[2][1] != arr[3][3]-arr[3][1] arr[1][3]-arr[1][1] != arr[2][3]-arr[2][1] arr[1][3]-arr[1][1] arr[1][3] arr[1] arr 1 3 arr[1][1] arr[1] arr 1 1 arr[2][3]-arr[2][1] arr[2][3] arr[2] arr 2 3 arr[2][1] arr[2] arr 2 1 arr[2][3]-arr[2][1] != arr[3][3]-arr[3][1] arr[2][3]-arr[2][1] arr[2][3] arr[2] arr 2 3 arr[2][1] arr[2] arr 2 1 arr[3][3]-arr[3][1] arr[3][3] arr[3] arr 3 3 arr[3][1] arr[3] arr 3 1 {
                //b3 - b1
                Ans = "No";
        } 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){


        int H,W,D;
        int count =0;
        Scanner input = new Scanner(System.in);
        String Ans = "Yes";
        int [][] arr = new int[4][4];

        for (int i=1; i<=3; i++ ) {
                for (int j=1; j<=3; j++ ) {
                        arr[i][j] = input.nextInt();
                }
        }

        if (arr[1][1]-arr[2][1] != arr[1][2]-arr[2][2] || arr[1][2]-arr[2][2] != arr[1][3]-arr[2][3]) {
                //a1 - a2
                Ans = "No";
        }else if (arr[2][1]-arr[3][1] != arr[2][2]-arr[3][2] || arr[2][2]-arr[3][2] != arr[2][3]-arr[3][3]) {
                //a2 - a3
                Ans = "No";
        }else if (arr[3][1]-arr[1][1] != arr[3][2]-arr[1][2] || arr[3][2]-arr[1][2] != arr[3][3]-arr[1][3]) {
                //a3 - a1
                Ans = "No";
        }else if (arr[1][1]-arr[1][2] != arr[2][1]-arr[2][2] || arr[2][1]-arr[2][2] != arr[3][1]-arr[3][2]) {
                //b1 - b2
                Ans = "No";
        }else if (arr[1][2]-arr[1][3] != arr[2][2]-arr[2][3] || arr[2][2]-arr[2][3] != arr[3][2]-arr[3][3]) {
                //b2 - b3
                Ans = "No";
        }else if (arr[1][3]-arr[1][1] != arr[2][3]-arr[2][1] || arr[2][3]-arr[2][1] != arr[3][3]-arr[3][1]) {
                //b3 - b1
                Ans = "No";
        }

        System.out.println(Ans);
}
} public class Main {

public static void main(String [] args){


        int H,W,D;
        int count =0;
        Scanner input = new Scanner(System.in);
        String Ans = "Yes";
        int [][] arr = new int[4][4];

        for (int i=1; i<=3; i++ ) {
                for (int j=1; j<=3; j++ ) {
                        arr[i][j] = input.nextInt();
                }
        }

        if (arr[1][1]-arr[2][1] != arr[1][2]-arr[2][2] || arr[1][2]-arr[2][2] != arr[1][3]-arr[2][3]) {
                //a1 - a2
                Ans = "No";
        }else if (arr[2][1]-arr[3][1] != arr[2][2]-arr[3][2] || arr[2][2]-arr[3][2] != arr[2][3]-arr[3][3]) {
                //a2 - a3
                Ans = "No";
        }else if (arr[3][1]-arr[1][1] != arr[3][2]-arr[1][2] || arr[3][2]-arr[1][2] != arr[3][3]-arr[1][3]) {
                //a3 - a1
                Ans = "No";
        }else if (arr[1][1]-arr[1][2] != arr[2][1]-arr[2][2] || arr[2][1]-arr[2][2] != arr[3][1]-arr[3][2]) {
                //b1 - b2
                Ans = "No";
        }else if (arr[1][2]-arr[1][3] != arr[2][2]-arr[2][3] || arr[2][2]-arr[2][3] != arr[3][2]-arr[3][3]) {
                //b2 - b3
                Ans = "No";
        }else if (arr[1][3]-arr[1][1] != arr[2][3]-arr[2][1] || arr[2][3]-arr[2][1] != arr[3][3]-arr[3][1]) {
                //b3 - b1
                Ans = "No";
        }

        System.out.println(Ans);
}
} Main
import java.util.Scanner;
import java.util.Arrays;

public class Main {

public static void main(String [] args){


        int H,W,D;
        int count =0;
        Scanner input = new Scanner(System.in);
        String Ans = "Yes";
        int [][] arr = new int[4][4];

        for (int i=1; i<=3; i++ ) {
                for (int j=1; j<=3; j++ ) {
                        arr[i][j] = input.nextInt();
                }
        }

        if (arr[1][1]-arr[2][1] != arr[1][2]-arr[2][2] || arr[1][2]-arr[2][2] != arr[1][3]-arr[2][3]) {
                //a1 - a2
                Ans = "No";
        }else if (arr[2][1]-arr[3][1] != arr[2][2]-arr[3][2] || arr[2][2]-arr[3][2] != arr[2][3]-arr[3][3]) {
                //a2 - a3
                Ans = "No";
        }else if (arr[3][1]-arr[1][1] != arr[3][2]-arr[1][2] || arr[3][2]-arr[1][2] != arr[3][3]-arr[1][3]) {
                //a3 - a1
                Ans = "No";
        }else if (arr[1][1]-arr[1][2] != arr[2][1]-arr[2][2] || arr[2][1]-arr[2][2] != arr[3][1]-arr[3][2]) {
                //b1 - b2
                Ans = "No";
        }else if (arr[1][2]-arr[1][3] != arr[2][2]-arr[2][3] || arr[2][2]-arr[2][3] != arr[3][2]-arr[3][3]) {
                //b2 - b3
                Ans = "No";
        }else if (arr[1][3]-arr[1][1] != arr[2][3]-arr[2][1] || arr[2][3]-arr[2][1] != arr[3][3]-arr[3][1]) {
                //b3 - b1
                Ans = "No";
        }

        System.out.println(Ans);
}
}
