import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) {Main instance = new Main();sc = instance.new Scanner();instance.solve();}
    private class Scanner {String[] s = new String[0];String regex = " ";int i = 0;BufferedReader br = new BufferedReader(new InputStreamReader(System.in));public String next() {try {if (i < s.length) { return s[i++];}String st = br.readLine();while ("".equals(st)) { st = br.readLine(); }s = st.split(regex, 0);i = 0;return s[i++];} catch (IOException e) { return null; }}public int nextInt(){return Integer.parseInt(next());}}        
    private static Scanner sc;

    private void solve() {
        int[][] c = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c[i][j] = sc.nextInt();
            }
        }
        int[] a = new int[3];
        int[] b = new int[3];
        int ret = 1;
        for (int i = 0; i <= 100; i++) {
            a[0] = i;
            for (int j = 0; j < 3; j++) {
                b[j] = c[0][j]-a[0];
            }
            for (int j = 0; j < 3; j++) {
                a[j] = c[j][1] - b[1];
            }
            ret = 1;
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 3; k++) {
                    ret *= a[j] + b[k] == c[j][k] ? 1 : 0;
                }
            }
            if (ret == 1){break;}
        }
        if (ret == 1){
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
    public static void main(String[] args) {Main instance = new Main();sc = instance.new Scanner();instance.solve();}
    private class Scanner {String[] s = new String[0];String regex = " ";int i = 0;BufferedReader br = new BufferedReader(new InputStreamReader(System.in));public String next() {try {if (i < s.length) { return s[i++];}String st = br.readLine();while ("".equals(st)) { st = br.readLine(); }s = st.split(regex, 0);i = 0;return s[i++];} catch (IOException e) { return null; }}public int nextInt(){return Integer.parseInt(next());}}        
    private static Scanner sc;

    private void solve() {
        int[][] c = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c[i][j] = sc.nextInt();
            }
        }
        int[] a = new int[3];
        int[] b = new int[3];
        int ret = 1;
        for (int i = 0; i <= 100; i++) {
            a[0] = i;
            for (int j = 0; j < 3; j++) {
                b[j] = c[0][j]-a[0];
            }
            for (int j = 0; j < 3; j++) {
                a[j] = c[j][1] - b[1];
            }
            ret = 1;
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 3; k++) {
                    ret *= a[j] + b[k] == c[j][k] ? 1 : 0;
                }
            }
            if (ret == 1){break;}
        }
        if (ret == 1){
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
} Main private static Scanner sc; sc public static void main(String[] args) {Main instance = new Main();sc = instance.new Scanner();instance.solve();} main {Main instance = new Main();sc = instance.new Scanner();instance.solve();} Main instance = new Main(); instance new Main() sc = instance.new Scanner() sc instance.new Scanner() instance instance instance.solve() instance.solve instance String[] args args private void solve() {
        int[][] c = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c[i][j] = sc.nextInt();
            }
        }
        int[] a = new int[3];
        int[] b = new int[3];
        int ret = 1;
        for (int i = 0; i <= 100; i++) {
            a[0] = i;
            for (int j = 0; j < 3; j++) {
                b[j] = c[0][j]-a[0];
            }
            for (int j = 0; j < 3; j++) {
                a[j] = c[j][1] - b[1];
            }
            ret = 1;
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 3; k++) {
                    ret *= a[j] + b[k] == c[j][k] ? 1 : 0;
                }
            }
            if (ret == 1){break;}
        }
        if (ret == 1){
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    } solve {
        int[][] c = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c[i][j] = sc.nextInt();
            }
        }
        int[] a = new int[3];
        int[] b = new int[3];
        int ret = 1;
        for (int i = 0; i <= 100; i++) {
            a[0] = i;
            for (int j = 0; j < 3; j++) {
                b[j] = c[0][j]-a[0];
            }
            for (int j = 0; j < 3; j++) {
                a[j] = c[j][1] - b[1];
            }
            ret = 1;
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 3; k++) {
                    ret *= a[j] + b[k] == c[j][k] ? 1 : 0;
                }
            }
            if (ret == 1){break;}
        }
        if (ret == 1){
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    } int[][] c = new int[3][3]; c new int[3][3] 3 3 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 int[] a = new int[3]; a new int[3] 3 int[] b = new int[3]; b new int[3] 3 int ret = 1; ret 1 for (int i = 0; i <= 100; i++) {
            a[0] = i;
            for (int j = 0; j < 3; j++) {
                b[j] = c[0][j]-a[0];
            }
            for (int j = 0; j < 3; j++) {
                a[j] = c[j][1] - b[1];
            }
            ret = 1;
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 3; k++) {
                    ret *= a[j] + b[k] == c[j][k] ? 1 : 0;
                }
            }
            if (ret == 1){break;}
        } int i = 0; int i = 0; i 0 i <= 100 i 100 i++ i++ i {
            a[0] = i;
            for (int j = 0; j < 3; j++) {
                b[j] = c[0][j]-a[0];
            }
            for (int j = 0; j < 3; j++) {
                a[j] = c[j][1] - b[1];
            }
            ret = 1;
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 3; k++) {
                    ret *= a[j] + b[k] == c[j][k] ? 1 : 0;
                }
            }
            if (ret == 1){break;}
        } {
            a[0] = i;
            for (int j = 0; j < 3; j++) {
                b[j] = c[0][j]-a[0];
            }
            for (int j = 0; j < 3; j++) {
                a[j] = c[j][1] - b[1];
            }
            ret = 1;
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 3; k++) {
                    ret *= a[j] + b[k] == c[j][k] ? 1 : 0;
                }
            }
            if (ret == 1){break;}
        } a[0] = i a[0] a 0 i for (int j = 0; j < 3; j++) {
                b[j] = c[0][j]-a[0];
            } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
                b[j] = c[0][j]-a[0];
            } {
                b[j] = c[0][j]-a[0];
            } b[j] = c[0][j]-a[0] b[j] b j c[0][j]-a[0] c[0][j] c[0] c 0 j a[0] a 0 for (int j = 0; j < 3; j++) {
                a[j] = c[j][1] - b[1];
            } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
                a[j] = c[j][1] - b[1];
            } {
                a[j] = c[j][1] - b[1];
            } a[j] = c[j][1] - b[1] a[j] a j c[j][1] - b[1] c[j][1] c[j] c j 1 b[1] b 1 ret = 1 ret 1 for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 3; k++) {
                    ret *= a[j] + b[k] == c[j][k] ? 1 : 0;
                }
            } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
                for (int k = 0; k < 3; k++) {
                    ret *= a[j] + b[k] == c[j][k] ? 1 : 0;
                }
            } {
                for (int k = 0; k < 3; k++) {
                    ret *= a[j] + b[k] == c[j][k] ? 1 : 0;
                }
            } for (int k = 0; k < 3; k++) {
                    ret *= a[j] + b[k] == c[j][k] ? 1 : 0;
                } int k = 0; int k = 0; k 0 k < 3 k 3 k++ k++ k {
                    ret *= a[j] + b[k] == c[j][k] ? 1 : 0;
                } {
                    ret *= a[j] + b[k] == c[j][k] ? 1 : 0;
                } ret *= a[j] + b[k] == c[j][k] ? 1 : 0 ret a[j] + b[k] == c[j][k] ? 1 : 0 a[j] + b[k] == c[j][k] a[j] + b[k] a[j] a j b[k] b k c[j][k] c[j] c j k 1 0 if (ret == 1){break;} ret == 1 ret 1 {break;} break; if (ret == 1){
            System.out.println("Yes");
        } else {
            System.out.println("No");
        } ret == 1 ret 1 {
            System.out.println("Yes");
        } System.out.println("Yes") System.out.println System.out System System.out "Yes" {
            System.out.println("No");
        } System.out.println("No") System.out.println System.out System System.out "No" private class Scanner {String[] s = new String[0];String regex = " ";int i = 0;BufferedReader br = new BufferedReader(new InputStreamReader(System.in));public String next() {try {if (i < s.length) { return s[i++];}String st = br.readLine();while ("".equals(st)) { st = br.readLine(); }s = st.split(regex, 0);i = 0;return s[i++];} catch (IOException e) { return null; }}public int nextInt(){return Integer.parseInt(next());}} Scanner String[] s = new String[0]; s new String[0] 0 String regex = " "; regex " " int i = 0; i 0 BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) public String next() {try {if (i < s.length) { return s[i++];}String st = br.readLine();while ("".equals(st)) { st = br.readLine(); }s = st.split(regex, 0);i = 0;return s[i++];} catch (IOException e) { return null; }} next {try {if (i < s.length) { return s[i++];}String st = br.readLine();while ("".equals(st)) { st = br.readLine(); }s = st.split(regex, 0);i = 0;return s[i++];} catch (IOException e) { return null; }} try {if (i < s.length) { return s[i++];}String st = br.readLine();while ("".equals(st)) { st = br.readLine(); }s = st.split(regex, 0);i = 0;return s[i++];} catch (IOException e) { return null; } catch (IOException e) { return null; } IOException e { return null; } return null; null {if (i < s.length) { return s[i++];}String st = br.readLine();while ("".equals(st)) { st = br.readLine(); }s = st.split(regex, 0);i = 0;return s[i++];} if (i < s.length) { return s[i++];} i < s.length i s.length s s.length { return s[i++];} return s[i++]; s[i++] s i++ i String st = br.readLine(); st br.readLine() br.readLine br while ("".equals(st)) { st = br.readLine(); } "".equals(st) "".equals "" st { st = br.readLine(); } st = br.readLine() st br.readLine() br.readLine br s = st.split(regex, 0) s st.split(regex, 0) st.split st regex 0 i = 0 i 0 return s[i++]; s[i++] s i++ i public int nextInt(){return Integer.parseInt(next());} nextInt {return Integer.parseInt(next());} return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next public class Main {
    public static void main(String[] args) {Main instance = new Main();sc = instance.new Scanner();instance.solve();}
    private class Scanner {String[] s = new String[0];String regex = " ";int i = 0;BufferedReader br = new BufferedReader(new InputStreamReader(System.in));public String next() {try {if (i < s.length) { return s[i++];}String st = br.readLine();while ("".equals(st)) { st = br.readLine(); }s = st.split(regex, 0);i = 0;return s[i++];} catch (IOException e) { return null; }}public int nextInt(){return Integer.parseInt(next());}}        
    private static Scanner sc;

    private void solve() {
        int[][] c = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c[i][j] = sc.nextInt();
            }
        }
        int[] a = new int[3];
        int[] b = new int[3];
        int ret = 1;
        for (int i = 0; i <= 100; i++) {
            a[0] = i;
            for (int j = 0; j < 3; j++) {
                b[j] = c[0][j]-a[0];
            }
            for (int j = 0; j < 3; j++) {
                a[j] = c[j][1] - b[1];
            }
            ret = 1;
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 3; k++) {
                    ret *= a[j] + b[k] == c[j][k] ? 1 : 0;
                }
            }
            if (ret == 1){break;}
        }
        if (ret == 1){
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
} public class Main {
    public static void main(String[] args) {Main instance = new Main();sc = instance.new Scanner();instance.solve();}
    private class Scanner {String[] s = new String[0];String regex = " ";int i = 0;BufferedReader br = new BufferedReader(new InputStreamReader(System.in));public String next() {try {if (i < s.length) { return s[i++];}String st = br.readLine();while ("".equals(st)) { st = br.readLine(); }s = st.split(regex, 0);i = 0;return s[i++];} catch (IOException e) { return null; }}public int nextInt(){return Integer.parseInt(next());}}        
    private static Scanner sc;

    private void solve() {
        int[][] c = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c[i][j] = sc.nextInt();
            }
        }
        int[] a = new int[3];
        int[] b = new int[3];
        int ret = 1;
        for (int i = 0; i <= 100; i++) {
            a[0] = i;
            for (int j = 0; j < 3; j++) {
                b[j] = c[0][j]-a[0];
            }
            for (int j = 0; j < 3; j++) {
                a[j] = c[j][1] - b[1];
            }
            ret = 1;
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 3; k++) {
                    ret *= a[j] + b[k] == c[j][k] ? 1 : 0;
                }
            }
            if (ret == 1){break;}
        }
        if (ret == 1){
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) {Main instance = new Main();sc = instance.new Scanner();instance.solve();}
    private class Scanner {String[] s = new String[0];String regex = " ";int i = 0;BufferedReader br = new BufferedReader(new InputStreamReader(System.in));public String next() {try {if (i < s.length) { return s[i++];}String st = br.readLine();while ("".equals(st)) { st = br.readLine(); }s = st.split(regex, 0);i = 0;return s[i++];} catch (IOException e) { return null; }}public int nextInt(){return Integer.parseInt(next());}}        
    private static Scanner sc;

    private void solve() {
        int[][] c = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c[i][j] = sc.nextInt();
            }
        }
        int[] a = new int[3];
        int[] b = new int[3];
        int ret = 1;
        for (int i = 0; i <= 100; i++) {
            a[0] = i;
            for (int j = 0; j < 3; j++) {
                b[j] = c[0][j]-a[0];
            }
            for (int j = 0; j < 3; j++) {
                a[j] = c[j][1] - b[1];
            }
            ret = 1;
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 3; k++) {
                    ret *= a[j] + b[k] == c[j][k] ? 1 : 0;
                }
            }
            if (ret == 1){break;}
        }
        if (ret == 1){
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}