import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * 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;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int c[][] = new int[3][3];
            for (int i = 0; i < 3; i++) {
                for (int j = 0; j < 3; j++) {
                    c[i][j] = Integer.parseInt(in.next());
                }
            }
            int rows[][] = new int[3][2];
            int cols[][] = new int[3][2];

            for (int i = 0; i < 3; i++) {
                rows[i][0] = c[i][0] - c[i][1];
                rows[i][1] = c[i][1] - c[i][2];
            }
            for (int i = 0; i < 3; i++) {
                cols[i][0] = c[0][i] - c[1][i];
                cols[i][1] = c[1][i] - c[2][i];
            }

            boolean ok = false;

            if (rows[0][0] == rows[1][0] && rows[1][0] == rows[2][0] &&
                    rows[0][1] == rows[1][1] && rows[1][1] == rows[2][1] &&
                    cols[0][0] == cols[1][0] && cols[1][0] == cols[2][0] &&
                    cols[0][1] == cols[1][1] && cols[1][1] == cols[2][1]) {
                ok = true;
            }
            out.println(ok ? "Yes" : "No");

        }

    }
}
 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.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int c[][] = new int[3][3];
            for (int i = 0; i < 3; i++) {
                for (int j = 0; j < 3; j++) {
                    c[i][j] = Integer.parseInt(in.next());
                }
            }
            int rows[][] = new int[3][2];
            int cols[][] = new int[3][2];

            for (int i = 0; i < 3; i++) {
                rows[i][0] = c[i][0] - c[i][1];
                rows[i][1] = c[i][1] - c[i][2];
            }
            for (int i = 0; i < 3; i++) {
                cols[i][0] = c[0][i] - c[1][i];
                cols[i][1] = c[1][i] - c[2][i];
            }

            boolean ok = false;

            if (rows[0][0] == rows[1][0] && rows[1][0] == rows[2][0] &&
                    rows[0][1] == rows[1][1] && rows[1][1] == rows[2][1] &&
                    cols[0][0] == cols[1][0] && cols[1][0] == cols[2][0] &&
                    cols[0][1] == cols[1][1] && cols[1][1] == cols[2][1]) {
                ok = true;
            }
            out.println(ok ? "Yes" : "No");

        }

    }
} Main public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        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 Scanner in = new Scanner(inputStream); in new Scanner(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) C solver = new C(); solver new C() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int c[][] = new int[3][3];
            for (int i = 0; i < 3; i++) {
                for (int j = 0; j < 3; j++) {
                    c[i][j] = Integer.parseInt(in.next());
                }
            }
            int rows[][] = new int[3][2];
            int cols[][] = new int[3][2];

            for (int i = 0; i < 3; i++) {
                rows[i][0] = c[i][0] - c[i][1];
                rows[i][1] = c[i][1] - c[i][2];
            }
            for (int i = 0; i < 3; i++) {
                cols[i][0] = c[0][i] - c[1][i];
                cols[i][1] = c[1][i] - c[2][i];
            }

            boolean ok = false;

            if (rows[0][0] == rows[1][0] && rows[1][0] == rows[2][0] &&
                    rows[0][1] == rows[1][1] && rows[1][1] == rows[2][1] &&
                    cols[0][0] == cols[1][0] && cols[1][0] == cols[2][0] &&
                    cols[0][1] == cols[1][1] && cols[1][1] == cols[2][1]) {
                ok = true;
            }
            out.println(ok ? "Yes" : "No");

        }

    } C public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int c[][] = new int[3][3];
            for (int i = 0; i < 3; i++) {
                for (int j = 0; j < 3; j++) {
                    c[i][j] = Integer.parseInt(in.next());
                }
            }
            int rows[][] = new int[3][2];
            int cols[][] = new int[3][2];

            for (int i = 0; i < 3; i++) {
                rows[i][0] = c[i][0] - c[i][1];
                rows[i][1] = c[i][1] - c[i][2];
            }
            for (int i = 0; i < 3; i++) {
                cols[i][0] = c[0][i] - c[1][i];
                cols[i][1] = c[1][i] - c[2][i];
            }

            boolean ok = false;

            if (rows[0][0] == rows[1][0] && rows[1][0] == rows[2][0] &&
                    rows[0][1] == rows[1][1] && rows[1][1] == rows[2][1] &&
                    cols[0][0] == cols[1][0] && cols[1][0] == cols[2][0] &&
                    cols[0][1] == cols[1][1] && cols[1][1] == cols[2][1]) {
                ok = true;
            }
            out.println(ok ? "Yes" : "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] = Integer.parseInt(in.next());
                }
            }
            int rows[][] = new int[3][2];
            int cols[][] = new int[3][2];

            for (int i = 0; i < 3; i++) {
                rows[i][0] = c[i][0] - c[i][1];
                rows[i][1] = c[i][1] - c[i][2];
            }
            for (int i = 0; i < 3; i++) {
                cols[i][0] = c[0][i] - c[1][i];
                cols[i][1] = c[1][i] - c[2][i];
            }

            boolean ok = false;

            if (rows[0][0] == rows[1][0] && rows[1][0] == rows[2][0] &&
                    rows[0][1] == rows[1][1] && rows[1][1] == rows[2][1] &&
                    cols[0][0] == cols[1][0] && cols[1][0] == cols[2][0] &&
                    cols[0][1] == cols[1][1] && cols[1][1] == cols[2][1]) {
                ok = true;
            }
            out.println(ok ? "Yes" : "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] = Integer.parseInt(in.next());
                }
            } 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] = Integer.parseInt(in.next());
                }
            } {
                for (int j = 0; j < 3; j++) {
                    c[i][j] = Integer.parseInt(in.next());
                }
            } for (int j = 0; j < 3; j++) {
                    c[i][j] = Integer.parseInt(in.next());
                } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
                    c[i][j] = Integer.parseInt(in.next());
                } {
                    c[i][j] = Integer.parseInt(in.next());
                } c[i][j] = Integer.parseInt(in.next()) c[i][j] c[i] c i j Integer.parseInt(in.next()) Integer.parseInt Integer in.next() in.next in int rows[][] = new int[3][2]; rows new int[3][2] 3 2 int cols[][] = new int[3][2]; cols new int[3][2] 3 2 for (int i = 0; i < 3; i++) {
                rows[i][0] = c[i][0] - c[i][1];
                rows[i][1] = c[i][1] - c[i][2];
            } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
                rows[i][0] = c[i][0] - c[i][1];
                rows[i][1] = c[i][1] - c[i][2];
            } {
                rows[i][0] = c[i][0] - c[i][1];
                rows[i][1] = c[i][1] - c[i][2];
            } rows[i][0] = c[i][0] - c[i][1] rows[i][0] rows[i] rows i 0 c[i][0] - c[i][1] c[i][0] c[i] c i 0 c[i][1] c[i] c i 1 rows[i][1] = c[i][1] - c[i][2] rows[i][1] rows[i] rows i 1 c[i][1] - c[i][2] c[i][1] c[i] c i 1 c[i][2] c[i] c i 2 for (int i = 0; i < 3; i++) {
                cols[i][0] = c[0][i] - c[1][i];
                cols[i][1] = c[1][i] - c[2][i];
            } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
                cols[i][0] = c[0][i] - c[1][i];
                cols[i][1] = c[1][i] - c[2][i];
            } {
                cols[i][0] = c[0][i] - c[1][i];
                cols[i][1] = c[1][i] - c[2][i];
            } cols[i][0] = c[0][i] - c[1][i] cols[i][0] cols[i] cols i 0 c[0][i] - c[1][i] c[0][i] c[0] c 0 i c[1][i] c[1] c 1 i cols[i][1] = c[1][i] - c[2][i] cols[i][1] cols[i] cols i 1 c[1][i] - c[2][i] c[1][i] c[1] c 1 i c[2][i] c[2] c 2 i boolean ok = false; ok false if (rows[0][0] == rows[1][0] && rows[1][0] == rows[2][0] &&
                    rows[0][1] == rows[1][1] && rows[1][1] == rows[2][1] &&
                    cols[0][0] == cols[1][0] && cols[1][0] == cols[2][0] &&
                    cols[0][1] == cols[1][1] && cols[1][1] == cols[2][1]) {
                ok = true;
            } rows[0][0] == rows[1][0] && rows[1][0] == rows[2][0] &&
                    rows[0][1] == rows[1][1] && rows[1][1] == rows[2][1] &&
                    cols[0][0] == cols[1][0] && cols[1][0] == cols[2][0] &&
                    cols[0][1] == cols[1][1] && cols[1][1] == cols[2][1] cols[0][1] == cols[1][1] cols[1][0] == cols[2][0] cols[0][0] == cols[1][0] rows[1][1] == rows[2][1] rows[0][1] == rows[1][1] rows[0][0] == rows[1][0] && rows[1][0] == rows[2][0] &&
                    rows[0][1] == rows[1][1] && rows[1][1] == rows[2][1] &&
                    cols[0][0] == cols[1][0] && cols[1][0] == cols[2][0] &&
                    cols[0][1] == cols[1][1] && cols[1][1] == cols[2][1] rows[0][0] == rows[1][0] rows[0][0] rows[0] rows 0 0 rows[1][0] rows[1] rows 1 0 rows[1][0] == rows[2][0] rows[1][0] rows[1] rows 1 0 rows[2][0] rows[2] rows 2 0 rows[0][1] == rows[1][1] rows[0][1] rows[0] rows 0 1 rows[1][1] rows[1] rows 1 1 rows[1][1] == rows[2][1] rows[1][1] rows[1] rows 1 1 rows[2][1] rows[2] rows 2 1 cols[0][0] == cols[1][0] cols[0][0] cols[0] cols 0 0 cols[1][0] cols[1] cols 1 0 cols[1][0] == cols[2][0] cols[1][0] cols[1] cols 1 0 cols[2][0] cols[2] cols 2 0 cols[0][1] == cols[1][1] cols[0][1] cols[0] cols 0 1 cols[1][1] cols[1] cols 1 1 cols[1][1] == cols[2][1] cols[1][1] cols[1] cols 1 1 cols[2][1] cols[2] cols 2 1 {
                ok = true;
            } ok = true ok true out.println(ok ? "Yes" : "No") out.println out ok ? "Yes" : "No" ok "Yes" "No" int testNumber testNumber Scanner in in PrintWriter out out public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int c[][] = new int[3][3];
            for (int i = 0; i < 3; i++) {
                for (int j = 0; j < 3; j++) {
                    c[i][j] = Integer.parseInt(in.next());
                }
            }
            int rows[][] = new int[3][2];
            int cols[][] = new int[3][2];

            for (int i = 0; i < 3; i++) {
                rows[i][0] = c[i][0] - c[i][1];
                rows[i][1] = c[i][1] - c[i][2];
            }
            for (int i = 0; i < 3; i++) {
                cols[i][0] = c[0][i] - c[1][i];
                cols[i][1] = c[1][i] - c[2][i];
            }

            boolean ok = false;

            if (rows[0][0] == rows[1][0] && rows[1][0] == rows[2][0] &&
                    rows[0][1] == rows[1][1] && rows[1][1] == rows[2][1] &&
                    cols[0][0] == cols[1][0] && cols[1][0] == cols[2][0] &&
                    cols[0][1] == cols[1][1] && cols[1][1] == cols[2][1]) {
                ok = true;
            }
            out.println(ok ? "Yes" : "No");

        }

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

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int c[][] = new int[3][3];
            for (int i = 0; i < 3; i++) {
                for (int j = 0; j < 3; j++) {
                    c[i][j] = Integer.parseInt(in.next());
                }
            }
            int rows[][] = new int[3][2];
            int cols[][] = new int[3][2];

            for (int i = 0; i < 3; i++) {
                rows[i][0] = c[i][0] - c[i][1];
                rows[i][1] = c[i][1] - c[i][2];
            }
            for (int i = 0; i < 3; i++) {
                cols[i][0] = c[0][i] - c[1][i];
                cols[i][1] = c[1][i] - c[2][i];
            }

            boolean ok = false;

            if (rows[0][0] == rows[1][0] && rows[1][0] == rows[2][0] &&
                    rows[0][1] == rows[1][1] && rows[1][1] == rows[2][1] &&
                    cols[0][0] == cols[1][0] && cols[1][0] == cols[2][0] &&
                    cols[0][1] == cols[1][1] && cols[1][1] == cols[2][1]) {
                ok = true;
            }
            out.println(ok ? "Yes" : "No");

        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * 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;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int c[][] = new int[3][3];
            for (int i = 0; i < 3; i++) {
                for (int j = 0; j < 3; j++) {
                    c[i][j] = Integer.parseInt(in.next());
                }
            }
            int rows[][] = new int[3][2];
            int cols[][] = new int[3][2];

            for (int i = 0; i < 3; i++) {
                rows[i][0] = c[i][0] - c[i][1];
                rows[i][1] = c[i][1] - c[i][2];
            }
            for (int i = 0; i < 3; i++) {
                cols[i][0] = c[0][i] - c[1][i];
                cols[i][1] = c[1][i] - c[2][i];
            }

            boolean ok = false;

            if (rows[0][0] == rows[1][0] && rows[1][0] == rows[2][0] &&
                    rows[0][1] == rows[1][1] && rows[1][1] == rows[2][1] &&
                    cols[0][0] == cols[1][0] && cols[1][0] == cols[2][0] &&
                    cols[0][1] == cols[1][1] && cols[1][1] == cols[2][1]) {
                ok = true;
            }
            out.println(ok ? "Yes" : "No");

        }

    }
}

