import java.util.Scanner;

class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int c[] = new int[9];
        for(int i=0;i<9;++i)c[i]=scan.nextInt();
        for(int i=0;i<2;++i){
            int d=c[i*3] - c[(i+1)*3];
            for(int j=0;j<3;++j){
                if(c[i*3+j]-c[(i+1)*3+j]!=d){
                    System.out.println("No");
                    return;
                }
            }
        }
        System.out.println("Yes");
    }
} import java.util.Scanner; Scanner java.util class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int c[] = new int[9];
        for(int i=0;i<9;++i)c[i]=scan.nextInt();
        for(int i=0;i<2;++i){
            int d=c[i*3] - c[(i+1)*3];
            for(int j=0;j<3;++j){
                if(c[i*3+j]-c[(i+1)*3+j]!=d){
                    System.out.println("No");
                    return;
                }
            }
        }
        System.out.println("Yes");
    }
} Main public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int c[] = new int[9];
        for(int i=0;i<9;++i)c[i]=scan.nextInt();
        for(int i=0;i<2;++i){
            int d=c[i*3] - c[(i+1)*3];
            for(int j=0;j<3;++j){
                if(c[i*3+j]-c[(i+1)*3+j]!=d){
                    System.out.println("No");
                    return;
                }
            }
        }
        System.out.println("Yes");
    } main {
        Scanner scan = new Scanner(System.in);
        int c[] = new int[9];
        for(int i=0;i<9;++i)c[i]=scan.nextInt();
        for(int i=0;i<2;++i){
            int d=c[i*3] - c[(i+1)*3];
            for(int j=0;j<3;++j){
                if(c[i*3+j]-c[(i+1)*3+j]!=d){
                    System.out.println("No");
                    return;
                }
            }
        }
        System.out.println("Yes");
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int c[] = new int[9]; c new int[9] 9 for(int i=0;i<9;++i)c[i]=scan.nextInt(); int i=0; int i=0; i 0 i<9 i 9 ++i ++i i c[i]=scan.nextInt(); c[i]=scan.nextInt() c[i] c i scan.nextInt() scan.nextInt scan for(int i=0;i<2;++i){
            int d=c[i*3] - c[(i+1)*3];
            for(int j=0;j<3;++j){
                if(c[i*3+j]-c[(i+1)*3+j]!=d){
                    System.out.println("No");
                    return;
                }
            }
        } int i=0; int i=0; i 0 i<2 i 2 ++i ++i i {
            int d=c[i*3] - c[(i+1)*3];
            for(int j=0;j<3;++j){
                if(c[i*3+j]-c[(i+1)*3+j]!=d){
                    System.out.println("No");
                    return;
                }
            }
        } {
            int d=c[i*3] - c[(i+1)*3];
            for(int j=0;j<3;++j){
                if(c[i*3+j]-c[(i+1)*3+j]!=d){
                    System.out.println("No");
                    return;
                }
            }
        } int d=c[i*3] - c[(i+1)*3]; d c[i*3] - c[(i+1)*3] c[i*3] c i*3 i 3 c[(i+1)*3] c (i+1)*3 (i+1) i 1 3 for(int j=0;j<3;++j){
                if(c[i*3+j]-c[(i+1)*3+j]!=d){
                    System.out.println("No");
                    return;
                }
            } int j=0; int j=0; j 0 j<3 j 3 ++j ++j j {
                if(c[i*3+j]-c[(i+1)*3+j]!=d){
                    System.out.println("No");
                    return;
                }
            } {
                if(c[i*3+j]-c[(i+1)*3+j]!=d){
                    System.out.println("No");
                    return;
                }
            } if(c[i*3+j]-c[(i+1)*3+j]!=d){
                    System.out.println("No");
                    return;
                } c[i*3+j]-c[(i+1)*3+j]!=d c[i*3+j]-c[(i+1)*3+j] c[i*3+j] c i*3+j i*3 i 3 j c[(i+1)*3+j] c (i+1)*3+j (i+1)*3 (i+1) i 1 3 j d {
                    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
import java.util.Scanner;

class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int c[] = new int[9];
        for(int i=0;i<9;++i)c[i]=scan.nextInt();
        for(int i=0;i<2;++i){
            int d=c[i*3] - c[(i+1)*3];
            for(int j=0;j<3;++j){
                if(c[i*3+j]-c[(i+1)*3+j]!=d){
                    System.out.println("No");
                    return;
                }
            }
        }
        System.out.println("Yes");
    }
}