import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {

    static int[][] C;

    public static void main(String[] args) {
        FastScanner sc = new FastScanner(System.in);

        C = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                C[i][j] = sc.nextInt();
            }
        }

        System.out.println(solve() ? "Yes" : "No");
    }

    static boolean solve() {
        int a0 = 0;
        int[] b = new int[3];
        for (int i = 0; i < 3; i++) {
            b[i] = C[0][i] - a0;
        }
        int[] a = new int[3];
        a[0] = a0;
        a[1] = C[1][0] - b[0];
        a[2] = C[2][0] - b[0];

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                if( a[i] + b[j] != C[i][j] ) return false;
            }
        }
        return true;
    }

    @SuppressWarnings("unused")
    static class FastScanner {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        FastScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        }

        String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        String nextLine() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken("\n");
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Arrays; Arrays java.util import java.util.StringTokenizer; StringTokenizer java.util public class Main {

    static int[][] C;

    public static void main(String[] args) {
        FastScanner sc = new FastScanner(System.in);

        C = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                C[i][j] = sc.nextInt();
            }
        }

        System.out.println(solve() ? "Yes" : "No");
    }

    static boolean solve() {
        int a0 = 0;
        int[] b = new int[3];
        for (int i = 0; i < 3; i++) {
            b[i] = C[0][i] - a0;
        }
        int[] a = new int[3];
        a[0] = a0;
        a[1] = C[1][0] - b[0];
        a[2] = C[2][0] - b[0];

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                if( a[i] + b[j] != C[i][j] ) return false;
            }
        }
        return true;
    }

    @SuppressWarnings("unused")
    static class FastScanner {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        FastScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        }

        String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        String nextLine() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken("\n");
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    }
} Main static int[][] C; C public static void main(String[] args) {
        FastScanner sc = new FastScanner(System.in);

        C = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                C[i][j] = sc.nextInt();
            }
        }

        System.out.println(solve() ? "Yes" : "No");
    } main {
        FastScanner sc = new FastScanner(System.in);

        C = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                C[i][j] = sc.nextInt();
            }
        }

        System.out.println(solve() ? "Yes" : "No");
    } FastScanner sc = new FastScanner(System.in); sc new FastScanner(System.in) 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 System.out.println(solve() ? "Yes" : "No") System.out.println System.out System System.out solve() ? "Yes" : "No" solve() solve "Yes" "No" String[] args args static boolean solve() {
        int a0 = 0;
        int[] b = new int[3];
        for (int i = 0; i < 3; i++) {
            b[i] = C[0][i] - a0;
        }
        int[] a = new int[3];
        a[0] = a0;
        a[1] = C[1][0] - b[0];
        a[2] = C[2][0] - b[0];

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                if( a[i] + b[j] != C[i][j] ) return false;
            }
        }
        return true;
    } solve {
        int a0 = 0;
        int[] b = new int[3];
        for (int i = 0; i < 3; i++) {
            b[i] = C[0][i] - a0;
        }
        int[] a = new int[3];
        a[0] = a0;
        a[1] = C[1][0] - b[0];
        a[2] = C[2][0] - b[0];

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                if( a[i] + b[j] != C[i][j] ) return false;
            }
        }
        return true;
    } int a0 = 0; a0 0 int[] b = new int[3]; b new int[3] 3 for (int i = 0; i < 3; i++) {
            b[i] = C[0][i] - a0;
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            b[i] = C[0][i] - a0;
        } {
            b[i] = C[0][i] - a0;
        } b[i] = C[0][i] - a0 b[i] b i C[0][i] - a0 C[0][i] C[0] C 0 i a0 int[] a = new int[3]; a new int[3] 3 a[0] = a0 a[0] a 0 a0 a[1] = C[1][0] - b[0] a[1] a 1 C[1][0] - b[0] C[1][0] C[1] C 1 0 b[0] b 0 a[2] = C[2][0] - b[0] a[2] a 2 C[2][0] - b[0] C[2][0] C[2] C 2 0 b[0] b 0 for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                if( a[i] + b[j] != C[i][j] ) return false;
            }
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            for (int j = 0; j < 3; j++) {
                if( a[i] + b[j] != C[i][j] ) return false;
            }
        } {
            for (int j = 0; j < 3; j++) {
                if( a[i] + b[j] != C[i][j] ) return false;
            }
        } for (int j = 0; j < 3; j++) {
                if( a[i] + b[j] != C[i][j] ) return false;
            } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
                if( a[i] + b[j] != C[i][j] ) return false;
            } {
                if( a[i] + b[j] != C[i][j] ) return false;
            } if( a[i] + b[j] != C[i][j] ) return false; a[i] + b[j] != C[i][j] a[i] + b[j] a[i] a i b[j] b j C[i][j] C[i] C i j return false; false return true; true static class FastScanner {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        FastScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        }

        String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        String nextLine() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken("\n");
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    } FastScanner private BufferedReader reader; reader private StringTokenizer tokenizer; tokenizer FastScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        } FastScanner {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        } reader = new BufferedReader(new InputStreamReader(in)) reader new BufferedReader(new InputStreamReader(in)) tokenizer = null tokenizer null InputStream in in String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        } next {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        } if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            } tokenizer == null || !tokenizer.hasMoreTokens() tokenizer == null tokenizer null !tokenizer.hasMoreTokens() tokenizer.hasMoreTokens() tokenizer.hasMoreTokens tokenizer {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            } try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                } IOException e {
                    throw new RuntimeException(e);
                } throw new RuntimeException(e); new RuntimeException(e) {
                    tokenizer = new StringTokenizer(reader.readLine());
                } tokenizer = new StringTokenizer(reader.readLine()) tokenizer new StringTokenizer(reader.readLine()) return tokenizer.nextToken(); tokenizer.nextToken() tokenizer.nextToken tokenizer String nextLine() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken("\n");
        } nextLine {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken("\n");
        } if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            } tokenizer == null || !tokenizer.hasMoreTokens() tokenizer == null tokenizer null !tokenizer.hasMoreTokens() tokenizer.hasMoreTokens() tokenizer.hasMoreTokens tokenizer {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            } try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                } IOException e {
                    throw new RuntimeException(e);
                } throw new RuntimeException(e); new RuntimeException(e) {
                    return reader.readLine();
                } return reader.readLine(); reader.readLine() reader.readLine reader return tokenizer.nextToken("\n"); tokenizer.nextToken("\n") tokenizer.nextToken tokenizer "\n" long nextLong() {
            return Long.parseLong(next());
        } nextLong {
            return Long.parseLong(next());
        } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next int nextInt() {
            return Integer.parseInt(next());
        } nextInt {
            return Integer.parseInt(next());
        } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        } nextIntArray {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        } int[] a = new int[n]; a new int[n] n for (int i = 0; i < n; i++)
                a[i] = nextInt(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i a[i] = nextInt(); a[i] = nextInt() a[i] a i nextInt() nextInt return a; a int n n long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        } nextLongArray {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        } long[] a = new long[n]; a new long[n] n for (int i = 0; i < n; i++)
                a[i] = nextLong(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i a[i] = nextLong(); a[i] = nextLong() a[i] a i nextLong() nextLong return a; a int n n public class Main {

    static int[][] C;

    public static void main(String[] args) {
        FastScanner sc = new FastScanner(System.in);

        C = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                C[i][j] = sc.nextInt();
            }
        }

        System.out.println(solve() ? "Yes" : "No");
    }

    static boolean solve() {
        int a0 = 0;
        int[] b = new int[3];
        for (int i = 0; i < 3; i++) {
            b[i] = C[0][i] - a0;
        }
        int[] a = new int[3];
        a[0] = a0;
        a[1] = C[1][0] - b[0];
        a[2] = C[2][0] - b[0];

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                if( a[i] + b[j] != C[i][j] ) return false;
            }
        }
        return true;
    }

    @SuppressWarnings("unused")
    static class FastScanner {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        FastScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        }

        String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        String nextLine() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken("\n");
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    }
} public class Main {

    static int[][] C;

    public static void main(String[] args) {
        FastScanner sc = new FastScanner(System.in);

        C = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                C[i][j] = sc.nextInt();
            }
        }

        System.out.println(solve() ? "Yes" : "No");
    }

    static boolean solve() {
        int a0 = 0;
        int[] b = new int[3];
        for (int i = 0; i < 3; i++) {
            b[i] = C[0][i] - a0;
        }
        int[] a = new int[3];
        a[0] = a0;
        a[1] = C[1][0] - b[0];
        a[2] = C[2][0] - b[0];

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                if( a[i] + b[j] != C[i][j] ) return false;
            }
        }
        return true;
    }

    @SuppressWarnings("unused")
    static class FastScanner {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        FastScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        }

        String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        String nextLine() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken("\n");
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {

    static int[][] C;

    public static void main(String[] args) {
        FastScanner sc = new FastScanner(System.in);

        C = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                C[i][j] = sc.nextInt();
            }
        }

        System.out.println(solve() ? "Yes" : "No");
    }

    static boolean solve() {
        int a0 = 0;
        int[] b = new int[3];
        for (int i = 0; i < 3; i++) {
            b[i] = C[0][i] - a0;
        }
        int[] a = new int[3];
        a[0] = a0;
        a[1] = C[1][0] - b[0];
        a[2] = C[2][0] - b[0];

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                if( a[i] + b[j] != C[i][j] ) return false;
            }
        }
        return true;
    }

    @SuppressWarnings("unused")
    static class FastScanner {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        FastScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        }

        String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        String nextLine() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken("\n");
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    }
}
