import java.util.Scanner;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.TreeMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;

class Main{
    static double mod = 1e9+7;

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        Library lib = new Library();
        int[][] c = new int[3][3];
        int[] rate = new int[2];
        for (int i=0;i<3;i++){
            for (int j=0;j<3;j++){
                c[i][j] = sc.nextInt();
            }
        }
        for (int i=1;i<3;i++){
            rate[i-1] = c[0][i] - c[0][i-1];
        }
        for (int i=1;i<3;i++){
            for (int j=1;j<3;j++){
                if (c[i][j]-c[i][j-1]!=rate[j-1]){
                    System.out.println("No");
                    return;
                }
            }
        }
        for (int i=1;i<3;i++){
            rate[i-1] = c[i][0] - c[i-1][0];
        }
        for (int i=1;i<3;i++){
            for (int j=1;j<3;j++){
                if (c[j][i]-c[j-1][i]!=rate[j-1]){
                    System.out.println("N0");
                    return;
                }
            }
        }
        System.out.println("Yes");
    }
}

class Library{
    static long a;
    static long b;

    public static long gcd(long a,long b){
        Library lib = new Library();
        if (a<b){
            lib.swap(a,b);
        }
        if (b==0){
            return a;
        } else {
            return gcd(b,a%b);
        }
    }

    public static void swap(long a,long b){
        long x = a;
        a = b;
        b = x;
        return;
    }
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.HashMap; HashMap java.util import java.util.TreeMap; TreeMap java.util import java.util.HashSet; HashSet java.util import java.util.List; List java.util import java.util.Map; Map java.util class Main{
    static double mod = 1e9+7;

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        Library lib = new Library();
        int[][] c = new int[3][3];
        int[] rate = new int[2];
        for (int i=0;i<3;i++){
            for (int j=0;j<3;j++){
                c[i][j] = sc.nextInt();
            }
        }
        for (int i=1;i<3;i++){
            rate[i-1] = c[0][i] - c[0][i-1];
        }
        for (int i=1;i<3;i++){
            for (int j=1;j<3;j++){
                if (c[i][j]-c[i][j-1]!=rate[j-1]){
                    System.out.println("No");
                    return;
                }
            }
        }
        for (int i=1;i<3;i++){
            rate[i-1] = c[i][0] - c[i-1][0];
        }
        for (int i=1;i<3;i++){
            for (int j=1;j<3;j++){
                if (c[j][i]-c[j-1][i]!=rate[j-1]){
                    System.out.println("N0");
                    return;
                }
            }
        }
        System.out.println("Yes");
    }
} Main static double mod = 1e9+7; mod 1e9+7 1e9 7 public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        Library lib = new Library();
        int[][] c = new int[3][3];
        int[] rate = new int[2];
        for (int i=0;i<3;i++){
            for (int j=0;j<3;j++){
                c[i][j] = sc.nextInt();
            }
        }
        for (int i=1;i<3;i++){
            rate[i-1] = c[0][i] - c[0][i-1];
        }
        for (int i=1;i<3;i++){
            for (int j=1;j<3;j++){
                if (c[i][j]-c[i][j-1]!=rate[j-1]){
                    System.out.println("No");
                    return;
                }
            }
        }
        for (int i=1;i<3;i++){
            rate[i-1] = c[i][0] - c[i-1][0];
        }
        for (int i=1;i<3;i++){
            for (int j=1;j<3;j++){
                if (c[j][i]-c[j-1][i]!=rate[j-1]){
                    System.out.println("N0");
                    return;
                }
            }
        }
        System.out.println("Yes");
    } main {
        Scanner sc = new Scanner(System.in);
        Library lib = new Library();
        int[][] c = new int[3][3];
        int[] rate = new int[2];
        for (int i=0;i<3;i++){
            for (int j=0;j<3;j++){
                c[i][j] = sc.nextInt();
            }
        }
        for (int i=1;i<3;i++){
            rate[i-1] = c[0][i] - c[0][i-1];
        }
        for (int i=1;i<3;i++){
            for (int j=1;j<3;j++){
                if (c[i][j]-c[i][j-1]!=rate[j-1]){
                    System.out.println("No");
                    return;
                }
            }
        }
        for (int i=1;i<3;i++){
            rate[i-1] = c[i][0] - c[i-1][0];
        }
        for (int i=1;i<3;i++){
            for (int j=1;j<3;j++){
                if (c[j][i]-c[j-1][i]!=rate[j-1]){
                    System.out.println("N0");
                    return;
                }
            }
        }
        System.out.println("Yes");
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) Library lib = new Library(); lib new Library() int[][] c = new int[3][3]; c new int[3][3] 3 3 int[] rate = new int[2]; rate new int[2] 2 for (int i=0;i<3;i++){
            for (int j=0;j<3;j++){
                c[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++){
                c[i][j] = sc.nextInt();
            }
        } {
            for (int j=0;j<3;j++){
                c[i][j] = sc.nextInt();
            }
        } for (int j=0;j<3;j++){
                c[i][j] = sc.nextInt();
            } int j=0; int j=0; j 0 j<3 j 3 j++ j++ j {
                c[i][j] = sc.nextInt();
            } {
                c[i][j] = sc.nextInt();
            } c[i][j] = sc.nextInt() c[i][j] c[i] c i j sc.nextInt() sc.nextInt sc for (int i=1;i<3;i++){
            rate[i-1] = c[0][i] - c[0][i-1];
        } int i=1; int i=1; i 1 i<3 i 3 i++ i++ i {
            rate[i-1] = c[0][i] - c[0][i-1];
        } {
            rate[i-1] = c[0][i] - c[0][i-1];
        } rate[i-1] = c[0][i] - c[0][i-1] rate[i-1] rate i-1 i 1 c[0][i] - c[0][i-1] c[0][i] c[0] c 0 i c[0][i-1] c[0] c 0 i-1 i 1 for (int i=1;i<3;i++){
            for (int j=1;j<3;j++){
                if (c[i][j]-c[i][j-1]!=rate[j-1]){
                    System.out.println("No");
                    return;
                }
            }
        } int i=1; int i=1; i 1 i<3 i 3 i++ i++ i {
            for (int j=1;j<3;j++){
                if (c[i][j]-c[i][j-1]!=rate[j-1]){
                    System.out.println("No");
                    return;
                }
            }
        } {
            for (int j=1;j<3;j++){
                if (c[i][j]-c[i][j-1]!=rate[j-1]){
                    System.out.println("No");
                    return;
                }
            }
        } for (int j=1;j<3;j++){
                if (c[i][j]-c[i][j-1]!=rate[j-1]){
                    System.out.println("No");
                    return;
                }
            } int j=1; int j=1; j 1 j<3 j 3 j++ j++ j {
                if (c[i][j]-c[i][j-1]!=rate[j-1]){
                    System.out.println("No");
                    return;
                }
            } {
                if (c[i][j]-c[i][j-1]!=rate[j-1]){
                    System.out.println("No");
                    return;
                }
            } if (c[i][j]-c[i][j-1]!=rate[j-1]){
                    System.out.println("No");
                    return;
                } c[i][j]-c[i][j-1]!=rate[j-1] c[i][j]-c[i][j-1] c[i][j] c[i] c i j c[i][j-1] c[i] c i j-1 j 1 rate[j-1] rate j-1 j 1 {
                    System.out.println("No");
                    return;
                } System.out.println("No") System.out.println System.out System System.out "No" return; for (int i=1;i<3;i++){
            rate[i-1] = c[i][0] - c[i-1][0];
        } int i=1; int i=1; i 1 i<3 i 3 i++ i++ i {
            rate[i-1] = c[i][0] - c[i-1][0];
        } {
            rate[i-1] = c[i][0] - c[i-1][0];
        } rate[i-1] = c[i][0] - c[i-1][0] rate[i-1] rate i-1 i 1 c[i][0] - c[i-1][0] c[i][0] c[i] c i 0 c[i-1][0] c[i-1] c i-1 i 1 0 for (int i=1;i<3;i++){
            for (int j=1;j<3;j++){
                if (c[j][i]-c[j-1][i]!=rate[j-1]){
                    System.out.println("N0");
                    return;
                }
            }
        } int i=1; int i=1; i 1 i<3 i 3 i++ i++ i {
            for (int j=1;j<3;j++){
                if (c[j][i]-c[j-1][i]!=rate[j-1]){
                    System.out.println("N0");
                    return;
                }
            }
        } {
            for (int j=1;j<3;j++){
                if (c[j][i]-c[j-1][i]!=rate[j-1]){
                    System.out.println("N0");
                    return;
                }
            }
        } for (int j=1;j<3;j++){
                if (c[j][i]-c[j-1][i]!=rate[j-1]){
                    System.out.println("N0");
                    return;
                }
            } int j=1; int j=1; j 1 j<3 j 3 j++ j++ j {
                if (c[j][i]-c[j-1][i]!=rate[j-1]){
                    System.out.println("N0");
                    return;
                }
            } {
                if (c[j][i]-c[j-1][i]!=rate[j-1]){
                    System.out.println("N0");
                    return;
                }
            } if (c[j][i]-c[j-1][i]!=rate[j-1]){
                    System.out.println("N0");
                    return;
                } c[j][i]-c[j-1][i]!=rate[j-1] c[j][i]-c[j-1][i] c[j][i] c[j] c j i c[j-1][i] c[j-1] c j-1 j 1 i rate[j-1] rate j-1 j 1 {
                    System.out.println("N0");
                    return;
                } System.out.println("N0") System.out.println System.out System System.out "N0" return; System.out.println("Yes") System.out.println System.out System System.out "Yes" String[] args args class Library{
    static long a;
    static long b;

    public static long gcd(long a,long b){
        Library lib = new Library();
        if (a<b){
            lib.swap(a,b);
        }
        if (b==0){
            return a;
        } else {
            return gcd(b,a%b);
        }
    }

    public static void swap(long a,long b){
        long x = a;
        a = b;
        b = x;
        return;
    }
} Library static long a; a static long b; b public static long gcd(long a,long b){
        Library lib = new Library();
        if (a<b){
            lib.swap(a,b);
        }
        if (b==0){
            return a;
        } else {
            return gcd(b,a%b);
        }
    } gcd {
        Library lib = new Library();
        if (a<b){
            lib.swap(a,b);
        }
        if (b==0){
            return a;
        } else {
            return gcd(b,a%b);
        }
    } Library lib = new Library(); lib new Library() if (a<b){
            lib.swap(a,b);
        } a<b a b {
            lib.swap(a,b);
        } lib.swap(a,b) lib.swap lib a b if (b==0){
            return a;
        } else {
            return gcd(b,a%b);
        } b==0 b 0 {
            return a;
        } return a; a {
            return gcd(b,a%b);
        } return gcd(b,a%b); gcd(b,a%b) gcd b a%b a b long a a long b b public static void swap(long a,long b){
        long x = a;
        a = b;
        b = x;
        return;
    } swap {
        long x = a;
        a = b;
        b = x;
        return;
    } long x = a; x a a = b a b b = x b x return; long a a long b b
import java.util.Scanner;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.TreeMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;

class Main{
    static double mod = 1e9+7;

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        Library lib = new Library();
        int[][] c = new int[3][3];
        int[] rate = new int[2];
        for (int i=0;i<3;i++){
            for (int j=0;j<3;j++){
                c[i][j] = sc.nextInt();
            }
        }
        for (int i=1;i<3;i++){
            rate[i-1] = c[0][i] - c[0][i-1];
        }
        for (int i=1;i<3;i++){
            for (int j=1;j<3;j++){
                if (c[i][j]-c[i][j-1]!=rate[j-1]){
                    System.out.println("No");
                    return;
                }
            }
        }
        for (int i=1;i<3;i++){
            rate[i-1] = c[i][0] - c[i-1][0];
        }
        for (int i=1;i<3;i++){
            for (int j=1;j<3;j++){
                if (c[j][i]-c[j-1][i]!=rate[j-1]){
                    System.out.println("N0");
                    return;
                }
            }
        }
        System.out.println("Yes");
    }
}

class Library{
    static long a;
    static long b;

    public static long gcd(long a,long b){
        Library lib = new Library();
        if (a<b){
            lib.swap(a,b);
        }
        if (b==0){
            return a;
        } else {
            return gcd(b,a%b);
        }
    }

    public static void swap(long a,long b){
        long x = a;
        a = b;
        b = x;
        return;
    }
}