import java.util.Scanner;

public class Main {

    public static void main (String [] args){
        Scanner  sc = new Scanner(System.in);
        String ans ="Yes";
        int list[][] =new int[3][3];
        for (int i=0;i<3;i++) {
            for(int j=0;j<3;j++) {
                int num = sc.nextInt();
                list[i][j] =num;
            }
        }
        int tmpListA [] = new int[3];
        int tmpListB [] = new int[3];
        tmpListA[0]=0;
        for (int i=0;i<3;i++) {
                tmpListB[i] = list[0][i] -tmpListA[0];
                tmpListA[i] = list[i][0] - tmpListB[0];
        }
        for (int i=0;i<3;i++) {
            for(int j=0;j<3;j++) {
                if(list[i][j] == (tmpListA[i]+tmpListB[j])) {
                    continue;
                }else {
                    ans = "No";
                    break;
                }
            }
        }
        System.out.println(ans);
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main (String [] args){
        Scanner  sc = new Scanner(System.in);
        String ans ="Yes";
        int list[][] =new int[3][3];
        for (int i=0;i<3;i++) {
            for(int j=0;j<3;j++) {
                int num = sc.nextInt();
                list[i][j] =num;
            }
        }
        int tmpListA [] = new int[3];
        int tmpListB [] = new int[3];
        tmpListA[0]=0;
        for (int i=0;i<3;i++) {
                tmpListB[i] = list[0][i] -tmpListA[0];
                tmpListA[i] = list[i][0] - tmpListB[0];
        }
        for (int i=0;i<3;i++) {
            for(int j=0;j<3;j++) {
                if(list[i][j] == (tmpListA[i]+tmpListB[j])) {
                    continue;
                }else {
                    ans = "No";
                    break;
                }
            }
        }
        System.out.println(ans);
    }
} Main public static void main (String [] args){
        Scanner  sc = new Scanner(System.in);
        String ans ="Yes";
        int list[][] =new int[3][3];
        for (int i=0;i<3;i++) {
            for(int j=0;j<3;j++) {
                int num = sc.nextInt();
                list[i][j] =num;
            }
        }
        int tmpListA [] = new int[3];
        int tmpListB [] = new int[3];
        tmpListA[0]=0;
        for (int i=0;i<3;i++) {
                tmpListB[i] = list[0][i] -tmpListA[0];
                tmpListA[i] = list[i][0] - tmpListB[0];
        }
        for (int i=0;i<3;i++) {
            for(int j=0;j<3;j++) {
                if(list[i][j] == (tmpListA[i]+tmpListB[j])) {
                    continue;
                }else {
                    ans = "No";
                    break;
                }
            }
        }
        System.out.println(ans);
    } main {
        Scanner  sc = new Scanner(System.in);
        String ans ="Yes";
        int list[][] =new int[3][3];
        for (int i=0;i<3;i++) {
            for(int j=0;j<3;j++) {
                int num = sc.nextInt();
                list[i][j] =num;
            }
        }
        int tmpListA [] = new int[3];
        int tmpListB [] = new int[3];
        tmpListA[0]=0;
        for (int i=0;i<3;i++) {
                tmpListB[i] = list[0][i] -tmpListA[0];
                tmpListA[i] = list[i][0] - tmpListB[0];
        }
        for (int i=0;i<3;i++) {
            for(int j=0;j<3;j++) {
                if(list[i][j] == (tmpListA[i]+tmpListB[j])) {
                    continue;
                }else {
                    ans = "No";
                    break;
                }
            }
        }
        System.out.println(ans);
    } Scanner  sc = new Scanner(System.in); sc new Scanner(System.in) String ans ="Yes"; ans "Yes" int list[][] =new int[3][3]; list new int[3][3] 3 3 for (int i=0;i<3;i++) {
            for(int j=0;j<3;j++) {
                int num = sc.nextInt();
                list[i][j] =num;
            }
        } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
            for(int j=0;j<3;j++) {
                int num = sc.nextInt();
                list[i][j] =num;
            }
        } {
            for(int j=0;j<3;j++) {
                int num = sc.nextInt();
                list[i][j] =num;
            }
        } for(int j=0;j<3;j++) {
                int num = sc.nextInt();
                list[i][j] =num;
            } int j=0; int j=0; j 0 j<3 j 3 j++ j++ j {
                int num = sc.nextInt();
                list[i][j] =num;
            } {
                int num = sc.nextInt();
                list[i][j] =num;
            } int num = sc.nextInt(); num sc.nextInt() sc.nextInt sc list[i][j] =num list[i][j] list[i] list i j num int tmpListA [] = new int[3]; tmpListA new int[3] 3 int tmpListB [] = new int[3]; tmpListB new int[3] 3 tmpListA[0]=0 tmpListA[0] tmpListA 0 0 for (int i=0;i<3;i++) {
                tmpListB[i] = list[0][i] -tmpListA[0];
                tmpListA[i] = list[i][0] - tmpListB[0];
        } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
                tmpListB[i] = list[0][i] -tmpListA[0];
                tmpListA[i] = list[i][0] - tmpListB[0];
        } {
                tmpListB[i] = list[0][i] -tmpListA[0];
                tmpListA[i] = list[i][0] - tmpListB[0];
        } tmpListB[i] = list[0][i] -tmpListA[0] tmpListB[i] tmpListB i list[0][i] -tmpListA[0] list[0][i] list[0] list 0 i tmpListA[0] tmpListA 0 tmpListA[i] = list[i][0] - tmpListB[0] tmpListA[i] tmpListA i list[i][0] - tmpListB[0] list[i][0] list[i] list i 0 tmpListB[0] tmpListB 0 for (int i=0;i<3;i++) {
            for(int j=0;j<3;j++) {
                if(list[i][j] == (tmpListA[i]+tmpListB[j])) {
                    continue;
                }else {
                    ans = "No";
                    break;
                }
            }
        } 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] == (tmpListA[i]+tmpListB[j])) {
                    continue;
                }else {
                    ans = "No";
                    break;
                }
            }
        } {
            for(int j=0;j<3;j++) {
                if(list[i][j] == (tmpListA[i]+tmpListB[j])) {
                    continue;
                }else {
                    ans = "No";
                    break;
                }
            }
        } for(int j=0;j<3;j++) {
                if(list[i][j] == (tmpListA[i]+tmpListB[j])) {
                    continue;
                }else {
                    ans = "No";
                    break;
                }
            } int j=0; int j=0; j 0 j<3 j 3 j++ j++ j {
                if(list[i][j] == (tmpListA[i]+tmpListB[j])) {
                    continue;
                }else {
                    ans = "No";
                    break;
                }
            } {
                if(list[i][j] == (tmpListA[i]+tmpListB[j])) {
                    continue;
                }else {
                    ans = "No";
                    break;
                }
            } if(list[i][j] == (tmpListA[i]+tmpListB[j])) {
                    continue;
                }else {
                    ans = "No";
                    break;
                } list[i][j] == (tmpListA[i]+tmpListB[j]) list[i][j] list[i] list i j (tmpListA[i]+tmpListB[j]) tmpListA[i] tmpListA i tmpListB[j] tmpListB j {
                    continue;
                } continue; {
                    ans = "No";
                    break;
                } ans = "No" ans "No" 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){
        Scanner  sc = new Scanner(System.in);
        String ans ="Yes";
        int list[][] =new int[3][3];
        for (int i=0;i<3;i++) {
            for(int j=0;j<3;j++) {
                int num = sc.nextInt();
                list[i][j] =num;
            }
        }
        int tmpListA [] = new int[3];
        int tmpListB [] = new int[3];
        tmpListA[0]=0;
        for (int i=0;i<3;i++) {
                tmpListB[i] = list[0][i] -tmpListA[0];
                tmpListA[i] = list[i][0] - tmpListB[0];
        }
        for (int i=0;i<3;i++) {
            for(int j=0;j<3;j++) {
                if(list[i][j] == (tmpListA[i]+tmpListB[j])) {
                    continue;
                }else {
                    ans = "No";
                    break;
                }
            }
        }
        System.out.println(ans);
    }
} public class Main {

    public static void main (String [] args){
        Scanner  sc = new Scanner(System.in);
        String ans ="Yes";
        int list[][] =new int[3][3];
        for (int i=0;i<3;i++) {
            for(int j=0;j<3;j++) {
                int num = sc.nextInt();
                list[i][j] =num;
            }
        }
        int tmpListA [] = new int[3];
        int tmpListB [] = new int[3];
        tmpListA[0]=0;
        for (int i=0;i<3;i++) {
                tmpListB[i] = list[0][i] -tmpListA[0];
                tmpListA[i] = list[i][0] - tmpListB[0];
        }
        for (int i=0;i<3;i++) {
            for(int j=0;j<3;j++) {
                if(list[i][j] == (tmpListA[i]+tmpListB[j])) {
                    continue;
                }else {
                    ans = "No";
                    break;
                }
            }
        }
        System.out.println(ans);
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main (String [] args){
        Scanner  sc = new Scanner(System.in);
        String ans ="Yes";
        int list[][] =new int[3][3];
        for (int i=0;i<3;i++) {
            for(int j=0;j<3;j++) {
                int num = sc.nextInt();
                list[i][j] =num;
            }
        }
        int tmpListA [] = new int[3];
        int tmpListB [] = new int[3];
        tmpListA[0]=0;
        for (int i=0;i<3;i++) {
                tmpListB[i] = list[0][i] -tmpListA[0];
                tmpListA[i] = list[i][0] - tmpListB[0];
        }
        for (int i=0;i<3;i++) {
            for(int j=0;j<3;j++) {
                if(list[i][j] == (tmpListA[i]+tmpListB[j])) {
                    continue;
                }else {
                    ans = "No";
                    break;
                }
            }
        }
        System.out.println(ans);
    }
}
