import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.util.InputMismatchException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int[][] c = new int[3][3];
            for (int i = 0; i < 3; i++) {
                c[i] = in.nextIntArray(3);
            }

            int[] dx = {c[0][1] - c[0][0], c[0][2] - c[0][1]};
            int[] dy = {c[1][0] - c[0][0], c[2][0] - c[1][0]};

            for (int i = 0; i < 2; i++) {
                for (int j = 0; j < 3; j++) {
                    if (c[j][i + 1] - c[j][i] != dx[i]) {
                        out.println("No");
                        return;
                    }

                    if (c[i + 1][j] - c[i][j] != dy[i]) {
                        out.println("No");
                        return;
                    }
                }
            }

            out.println("Yes");
        }

    }

    static class InputReader {
        BufferedReader in;
        StringTokenizer tok;

        public String nextString() {
            while (!tok.hasMoreTokens()) {
                try {
                    tok = new StringTokenizer(in.readLine(), " ");
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
            }
            return tok.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(nextString());
        }

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

        public InputReader(InputStream inputStream) {
            in = new BufferedReader(new InputStreamReader(inputStream));
            tok = new StringTokenizer("");
        }

    }
}
 import java.io.OutputStream; OutputStream java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.StringTokenizer; StringTokenizer java.util import java.io.IOException; IOException java.io import java.util.InputMismatchException; InputMismatchException java.util import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.InputStream; InputStream java.io public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int[][] c = new int[3][3];
            for (int i = 0; i < 3; i++) {
                c[i] = in.nextIntArray(3);
            }

            int[] dx = {c[0][1] - c[0][0], c[0][2] - c[0][1]};
            int[] dy = {c[1][0] - c[0][0], c[2][0] - c[1][0]};

            for (int i = 0; i < 2; i++) {
                for (int j = 0; j < 3; j++) {
                    if (c[j][i + 1] - c[j][i] != dx[i]) {
                        out.println("No");
                        return;
                    }

                    if (c[i + 1][j] - c[i][j] != dy[i]) {
                        out.println("No");
                        return;
                    }
                }
            }

            out.println("Yes");
        }

    }

    static class InputReader {
        BufferedReader in;
        StringTokenizer tok;

        public String nextString() {
            while (!tok.hasMoreTokens()) {
                try {
                    tok = new StringTokenizer(in.readLine(), " ");
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
            }
            return tok.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(nextString());
        }

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

        public InputReader(InputStream inputStream) {
            in = new BufferedReader(new InputStreamReader(inputStream));
            tok = new StringTokenizer("");
        }

    }
} Main public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    } InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out InputReader in = new InputReader(inputStream); in new InputReader(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) TaskC solver = new TaskC(); solver new TaskC() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class TaskC {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int[][] c = new int[3][3];
            for (int i = 0; i < 3; i++) {
                c[i] = in.nextIntArray(3);
            }

            int[] dx = {c[0][1] - c[0][0], c[0][2] - c[0][1]};
            int[] dy = {c[1][0] - c[0][0], c[2][0] - c[1][0]};

            for (int i = 0; i < 2; i++) {
                for (int j = 0; j < 3; j++) {
                    if (c[j][i + 1] - c[j][i] != dx[i]) {
                        out.println("No");
                        return;
                    }

                    if (c[i + 1][j] - c[i][j] != dy[i]) {
                        out.println("No");
                        return;
                    }
                }
            }

            out.println("Yes");
        }

    } TaskC public void solve(int testNumber, InputReader in, PrintWriter out) {
            int[][] c = new int[3][3];
            for (int i = 0; i < 3; i++) {
                c[i] = in.nextIntArray(3);
            }

            int[] dx = {c[0][1] - c[0][0], c[0][2] - c[0][1]};
            int[] dy = {c[1][0] - c[0][0], c[2][0] - c[1][0]};

            for (int i = 0; i < 2; i++) {
                for (int j = 0; j < 3; j++) {
                    if (c[j][i + 1] - c[j][i] != dx[i]) {
                        out.println("No");
                        return;
                    }

                    if (c[i + 1][j] - c[i][j] != dy[i]) {
                        out.println("No");
                        return;
                    }
                }
            }

            out.println("Yes");
        } solve {
            int[][] c = new int[3][3];
            for (int i = 0; i < 3; i++) {
                c[i] = in.nextIntArray(3);
            }

            int[] dx = {c[0][1] - c[0][0], c[0][2] - c[0][1]};
            int[] dy = {c[1][0] - c[0][0], c[2][0] - c[1][0]};

            for (int i = 0; i < 2; i++) {
                for (int j = 0; j < 3; j++) {
                    if (c[j][i + 1] - c[j][i] != dx[i]) {
                        out.println("No");
                        return;
                    }

                    if (c[i + 1][j] - c[i][j] != dy[i]) {
                        out.println("No");
                        return;
                    }
                }
            }

            out.println("Yes");
        } int[][] c = new int[3][3]; c new int[3][3] 3 3 for (int i = 0; i < 3; i++) {
                c[i] = in.nextIntArray(3);
            } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
                c[i] = in.nextIntArray(3);
            } {
                c[i] = in.nextIntArray(3);
            } c[i] = in.nextIntArray(3) c[i] c i in.nextIntArray(3) in.nextIntArray in 3 int[] dx = {c[0][1] - c[0][0], c[0][2] - c[0][1]}; dx {c[0][1] - c[0][0], c[0][2] - c[0][1]} c[0][1] - c[0][0] c[0][1] c[0] c 0 1 c[0][0] c[0] c 0 0 c[0][2] - c[0][1] c[0][2] c[0] c 0 2 c[0][1] c[0] c 0 1 int[] dy = {c[1][0] - c[0][0], c[2][0] - c[1][0]}; dy {c[1][0] - c[0][0], c[2][0] - c[1][0]} c[1][0] - c[0][0] c[1][0] c[1] c 1 0 c[0][0] c[0] c 0 0 c[2][0] - c[1][0] c[2][0] c[2] c 2 0 c[1][0] c[1] c 1 0 for (int i = 0; i < 2; i++) {
                for (int j = 0; j < 3; j++) {
                    if (c[j][i + 1] - c[j][i] != dx[i]) {
                        out.println("No");
                        return;
                    }

                    if (c[i + 1][j] - c[i][j] != dy[i]) {
                        out.println("No");
                        return;
                    }
                }
            } int i = 0; int i = 0; i 0 i < 2 i 2 i++ i++ i {
                for (int j = 0; j < 3; j++) {
                    if (c[j][i + 1] - c[j][i] != dx[i]) {
                        out.println("No");
                        return;
                    }

                    if (c[i + 1][j] - c[i][j] != dy[i]) {
                        out.println("No");
                        return;
                    }
                }
            } {
                for (int j = 0; j < 3; j++) {
                    if (c[j][i + 1] - c[j][i] != dx[i]) {
                        out.println("No");
                        return;
                    }

                    if (c[i + 1][j] - c[i][j] != dy[i]) {
                        out.println("No");
                        return;
                    }
                }
            } for (int j = 0; j < 3; j++) {
                    if (c[j][i + 1] - c[j][i] != dx[i]) {
                        out.println("No");
                        return;
                    }

                    if (c[i + 1][j] - c[i][j] != dy[i]) {
                        out.println("No");
                        return;
                    }
                } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
                    if (c[j][i + 1] - c[j][i] != dx[i]) {
                        out.println("No");
                        return;
                    }

                    if (c[i + 1][j] - c[i][j] != dy[i]) {
                        out.println("No");
                        return;
                    }
                } {
                    if (c[j][i + 1] - c[j][i] != dx[i]) {
                        out.println("No");
                        return;
                    }

                    if (c[i + 1][j] - c[i][j] != dy[i]) {
                        out.println("No");
                        return;
                    }
                } if (c[j][i + 1] - c[j][i] != dx[i]) {
                        out.println("No");
                        return;
                    } c[j][i + 1] - c[j][i] != dx[i] c[j][i + 1] - c[j][i] c[j][i + 1] c[j] c j i + 1 i 1 c[j][i] c[j] c j i dx[i] dx i {
                        out.println("No");
                        return;
                    } out.println("No") out.println out "No" return; if (c[i + 1][j] - c[i][j] != dy[i]) {
                        out.println("No");
                        return;
                    } c[i + 1][j] - c[i][j] != dy[i] c[i + 1][j] - c[i][j] c[i + 1][j] c[i + 1] c i + 1 i 1 j c[i][j] c[i] c i j dy[i] dy i {
                        out.println("No");
                        return;
                    } out.println("No") out.println out "No" return; out.println("Yes") out.println out "Yes" int testNumber testNumber InputReader in in PrintWriter out out static class InputReader {
        BufferedReader in;
        StringTokenizer tok;

        public String nextString() {
            while (!tok.hasMoreTokens()) {
                try {
                    tok = new StringTokenizer(in.readLine(), " ");
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
            }
            return tok.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(nextString());
        }

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

        public InputReader(InputStream inputStream) {
            in = new BufferedReader(new InputStreamReader(inputStream));
            tok = new StringTokenizer("");
        }

    } InputReader BufferedReader in; in StringTokenizer tok; tok public String nextString() {
            while (!tok.hasMoreTokens()) {
                try {
                    tok = new StringTokenizer(in.readLine(), " ");
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
            }
            return tok.nextToken();
        } nextString {
            while (!tok.hasMoreTokens()) {
                try {
                    tok = new StringTokenizer(in.readLine(), " ");
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
            }
            return tok.nextToken();
        } while (!tok.hasMoreTokens()) {
                try {
                    tok = new StringTokenizer(in.readLine(), " ");
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
            } !tok.hasMoreTokens() tok.hasMoreTokens() tok.hasMoreTokens tok {
                try {
                    tok = new StringTokenizer(in.readLine(), " ");
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
            } try {
                    tok = new StringTokenizer(in.readLine(), " ");
                } catch (IOException e) {
                    throw new InputMismatchException();
                } catch (IOException e) {
                    throw new InputMismatchException();
                } IOException e {
                    throw new InputMismatchException();
                } throw new InputMismatchException(); new InputMismatchException() {
                    tok = new StringTokenizer(in.readLine(), " ");
                } tok = new StringTokenizer(in.readLine(), " ") tok new StringTokenizer(in.readLine(), " ") return tok.nextToken(); tok.nextToken() tok.nextToken tok public int nextInt() {
            return Integer.parseInt(nextString());
        } nextInt {
            return Integer.parseInt(nextString());
        } return Integer.parseInt(nextString()); Integer.parseInt(nextString()) Integer.parseInt Integer nextString() nextString public int[] nextIntArray(int n) {
            int[] res = new int[n];
            for (int i = 0; i < n; i++) {
                res[i] = nextInt();
            }
            return res;
        } nextIntArray {
            int[] res = new int[n];
            for (int i = 0; i < n; i++) {
                res[i] = nextInt();
            }
            return res;
        } int[] res = new int[n]; res new int[n] n for (int i = 0; i < n; i++) {
                res[i] = nextInt();
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                res[i] = nextInt();
            } {
                res[i] = nextInt();
            } res[i] = nextInt() res[i] res i nextInt() nextInt return res; res int n n public InputReader(InputStream inputStream) {
            in = new BufferedReader(new InputStreamReader(inputStream));
            tok = new StringTokenizer("");
        } InputReader {
            in = new BufferedReader(new InputStreamReader(inputStream));
            tok = new StringTokenizer("");
        } in = new BufferedReader(new InputStreamReader(inputStream)) in new BufferedReader(new InputStreamReader(inputStream)) tok = new StringTokenizer("") tok new StringTokenizer("") InputStream inputStream inputStream public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int[][] c = new int[3][3];
            for (int i = 0; i < 3; i++) {
                c[i] = in.nextIntArray(3);
            }

            int[] dx = {c[0][1] - c[0][0], c[0][2] - c[0][1]};
            int[] dy = {c[1][0] - c[0][0], c[2][0] - c[1][0]};

            for (int i = 0; i < 2; i++) {
                for (int j = 0; j < 3; j++) {
                    if (c[j][i + 1] - c[j][i] != dx[i]) {
                        out.println("No");
                        return;
                    }

                    if (c[i + 1][j] - c[i][j] != dy[i]) {
                        out.println("No");
                        return;
                    }
                }
            }

            out.println("Yes");
        }

    }

    static class InputReader {
        BufferedReader in;
        StringTokenizer tok;

        public String nextString() {
            while (!tok.hasMoreTokens()) {
                try {
                    tok = new StringTokenizer(in.readLine(), " ");
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
            }
            return tok.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(nextString());
        }

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

        public InputReader(InputStream inputStream) {
            in = new BufferedReader(new InputStreamReader(inputStream));
            tok = new StringTokenizer("");
        }

    }
} public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int[][] c = new int[3][3];
            for (int i = 0; i < 3; i++) {
                c[i] = in.nextIntArray(3);
            }

            int[] dx = {c[0][1] - c[0][0], c[0][2] - c[0][1]};
            int[] dy = {c[1][0] - c[0][0], c[2][0] - c[1][0]};

            for (int i = 0; i < 2; i++) {
                for (int j = 0; j < 3; j++) {
                    if (c[j][i + 1] - c[j][i] != dx[i]) {
                        out.println("No");
                        return;
                    }

                    if (c[i + 1][j] - c[i][j] != dy[i]) {
                        out.println("No");
                        return;
                    }
                }
            }

            out.println("Yes");
        }

    }

    static class InputReader {
        BufferedReader in;
        StringTokenizer tok;

        public String nextString() {
            while (!tok.hasMoreTokens()) {
                try {
                    tok = new StringTokenizer(in.readLine(), " ");
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
            }
            return tok.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(nextString());
        }

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

        public InputReader(InputStream inputStream) {
            in = new BufferedReader(new InputStreamReader(inputStream));
            tok = new StringTokenizer("");
        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.util.InputMismatchException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int[][] c = new int[3][3];
            for (int i = 0; i < 3; i++) {
                c[i] = in.nextIntArray(3);
            }

            int[] dx = {c[0][1] - c[0][0], c[0][2] - c[0][1]};
            int[] dy = {c[1][0] - c[0][0], c[2][0] - c[1][0]};

            for (int i = 0; i < 2; i++) {
                for (int j = 0; j < 3; j++) {
                    if (c[j][i + 1] - c[j][i] != dx[i]) {
                        out.println("No");
                        return;
                    }

                    if (c[i + 1][j] - c[i][j] != dy[i]) {
                        out.println("No");
                        return;
                    }
                }
            }

            out.println("Yes");
        }

    }

    static class InputReader {
        BufferedReader in;
        StringTokenizer tok;

        public String nextString() {
            while (!tok.hasMoreTokens()) {
                try {
                    tok = new StringTokenizer(in.readLine(), " ");
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
            }
            return tok.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(nextString());
        }

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

        public InputReader(InputStream inputStream) {
            in = new BufferedReader(new InputStreamReader(inputStream));
            tok = new StringTokenizer("");
        }

    }
}

