import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.IOException;
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++) {
                for (int j = 0; j < 3; j++) {
                    c[i][j] = in.nextInt();
                }
            }

            for (int a0 = 0; a0 <= 100; a0++) {
                for (int a1 = 0; a1 <= 100; a1++) {
                    nextiter:
                    for (int a2 = 0; a2 <= 100; a2++) {
                        for (int i = 0; i < 3; i++) {
                            if (c[i][0] - a0 == c[i][1] - a1 && c[i][1] - a1 == c[i][2] - a2) {

                            } else {
                                continue nextiter;
                            }
                        }
                        out.println("Yes");
                        return;

                    }
                }
            }
            out.println("No");
        }

    }

    static class InputReader {
        final InputStream is;
        final byte[] buffer = new byte[1024];
        int curCharIdx;
        int nChars;

        public InputReader(InputStream is) {
            this.is = is;
        }

        public int read() {
            if (curCharIdx >= nChars) {
                try {
                    curCharIdx = 0;
                    nChars = is.read(buffer);
                    if (nChars == -1) {
                        return -1;
                    }
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return buffer[curCharIdx++];
        }

        public int nextInt() {
            int sign = 1;
            int c = skipDelims();
            if (c == '-') {
                sign = -1;
                c = read();
                if (isDelim(c)) {
                    throw new RuntimeException("Incorrect format");
                }
            }
            int val = 0;
            while (c != -1 && !isDelim(c)) {
                if (!isDigit(c)) {
                    throw new RuntimeException("Incorrect format");
                }
                val = 10 * val + (c - '0');
                c = read();
            }
            return val * sign;
        }

        private final int skipDelims() {
            int c = read();
            while (isDelim(c)) {
                c = read();
            }
            return c;
        }

        private static boolean isDelim(final int c) {
            return c == ' ' ||
                   c == '\n' ||
                   c == '\t' ||
                   c == '\r' ||
                   c == '\f';
        }

        private static boolean isDigit(final int c) {
            return '0' <= c && c <= '9';
        }

    }
}
 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.io.IOException; IOException 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++) {
                for (int j = 0; j < 3; j++) {
                    c[i][j] = in.nextInt();
                }
            }

            for (int a0 = 0; a0 <= 100; a0++) {
                for (int a1 = 0; a1 <= 100; a1++) {
                    nextiter:
                    for (int a2 = 0; a2 <= 100; a2++) {
                        for (int i = 0; i < 3; i++) {
                            if (c[i][0] - a0 == c[i][1] - a1 && c[i][1] - a1 == c[i][2] - a2) {

                            } else {
                                continue nextiter;
                            }
                        }
                        out.println("Yes");
                        return;

                    }
                }
            }
            out.println("No");
        }

    }

    static class InputReader {
        final InputStream is;
        final byte[] buffer = new byte[1024];
        int curCharIdx;
        int nChars;

        public InputReader(InputStream is) {
            this.is = is;
        }

        public int read() {
            if (curCharIdx >= nChars) {
                try {
                    curCharIdx = 0;
                    nChars = is.read(buffer);
                    if (nChars == -1) {
                        return -1;
                    }
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return buffer[curCharIdx++];
        }

        public int nextInt() {
            int sign = 1;
            int c = skipDelims();
            if (c == '-') {
                sign = -1;
                c = read();
                if (isDelim(c)) {
                    throw new RuntimeException("Incorrect format");
                }
            }
            int val = 0;
            while (c != -1 && !isDelim(c)) {
                if (!isDigit(c)) {
                    throw new RuntimeException("Incorrect format");
                }
                val = 10 * val + (c - '0');
                c = read();
            }
            return val * sign;
        }

        private final int skipDelims() {
            int c = read();
            while (isDelim(c)) {
                c = read();
            }
            return c;
        }

        private static boolean isDelim(final int c) {
            return c == ' ' ||
                   c == '\n' ||
                   c == '\t' ||
                   c == '\r' ||
                   c == '\f';
        }

        private static boolean isDigit(final int c) {
            return '0' <= c && c <= '9';
        }

    }
} 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++) {
                for (int j = 0; j < 3; j++) {
                    c[i][j] = in.nextInt();
                }
            }

            for (int a0 = 0; a0 <= 100; a0++) {
                for (int a1 = 0; a1 <= 100; a1++) {
                    nextiter:
                    for (int a2 = 0; a2 <= 100; a2++) {
                        for (int i = 0; i < 3; i++) {
                            if (c[i][0] - a0 == c[i][1] - a1 && c[i][1] - a1 == c[i][2] - a2) {

                            } else {
                                continue nextiter;
                            }
                        }
                        out.println("Yes");
                        return;

                    }
                }
            }
            out.println("No");
        }

    } TaskC public void solve(int testNumber, InputReader 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] = in.nextInt();
                }
            }

            for (int a0 = 0; a0 <= 100; a0++) {
                for (int a1 = 0; a1 <= 100; a1++) {
                    nextiter:
                    for (int a2 = 0; a2 <= 100; a2++) {
                        for (int i = 0; i < 3; i++) {
                            if (c[i][0] - a0 == c[i][1] - a1 && c[i][1] - a1 == c[i][2] - a2) {

                            } else {
                                continue nextiter;
                            }
                        }
                        out.println("Yes");
                        return;

                    }
                }
            }
            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] = in.nextInt();
                }
            }

            for (int a0 = 0; a0 <= 100; a0++) {
                for (int a1 = 0; a1 <= 100; a1++) {
                    nextiter:
                    for (int a2 = 0; a2 <= 100; a2++) {
                        for (int i = 0; i < 3; i++) {
                            if (c[i][0] - a0 == c[i][1] - a1 && c[i][1] - a1 == c[i][2] - a2) {

                            } else {
                                continue nextiter;
                            }
                        }
                        out.println("Yes");
                        return;

                    }
                }
            }
            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] = in.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] = in.nextInt();
                }
            } {
                for (int j = 0; j < 3; j++) {
                    c[i][j] = in.nextInt();
                }
            } for (int j = 0; j < 3; j++) {
                    c[i][j] = in.nextInt();
                } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
                    c[i][j] = in.nextInt();
                } {
                    c[i][j] = in.nextInt();
                } c[i][j] = in.nextInt() c[i][j] c[i] c i j in.nextInt() in.nextInt in for (int a0 = 0; a0 <= 100; a0++) {
                for (int a1 = 0; a1 <= 100; a1++) {
                    nextiter:
                    for (int a2 = 0; a2 <= 100; a2++) {
                        for (int i = 0; i < 3; i++) {
                            if (c[i][0] - a0 == c[i][1] - a1 && c[i][1] - a1 == c[i][2] - a2) {

                            } else {
                                continue nextiter;
                            }
                        }
                        out.println("Yes");
                        return;

                    }
                }
            } int a0 = 0; int a0 = 0; a0 0 a0 <= 100 a0 100 a0++ a0++ a0 {
                for (int a1 = 0; a1 <= 100; a1++) {
                    nextiter:
                    for (int a2 = 0; a2 <= 100; a2++) {
                        for (int i = 0; i < 3; i++) {
                            if (c[i][0] - a0 == c[i][1] - a1 && c[i][1] - a1 == c[i][2] - a2) {

                            } else {
                                continue nextiter;
                            }
                        }
                        out.println("Yes");
                        return;

                    }
                }
            } {
                for (int a1 = 0; a1 <= 100; a1++) {
                    nextiter:
                    for (int a2 = 0; a2 <= 100; a2++) {
                        for (int i = 0; i < 3; i++) {
                            if (c[i][0] - a0 == c[i][1] - a1 && c[i][1] - a1 == c[i][2] - a2) {

                            } else {
                                continue nextiter;
                            }
                        }
                        out.println("Yes");
                        return;

                    }
                }
            } for (int a1 = 0; a1 <= 100; a1++) {
                    nextiter:
                    for (int a2 = 0; a2 <= 100; a2++) {
                        for (int i = 0; i < 3; i++) {
                            if (c[i][0] - a0 == c[i][1] - a1 && c[i][1] - a1 == c[i][2] - a2) {

                            } else {
                                continue nextiter;
                            }
                        }
                        out.println("Yes");
                        return;

                    }
                } int a1 = 0; int a1 = 0; a1 0 a1 <= 100 a1 100 a1++ a1++ a1 {
                    nextiter:
                    for (int a2 = 0; a2 <= 100; a2++) {
                        for (int i = 0; i < 3; i++) {
                            if (c[i][0] - a0 == c[i][1] - a1 && c[i][1] - a1 == c[i][2] - a2) {

                            } else {
                                continue nextiter;
                            }
                        }
                        out.println("Yes");
                        return;

                    }
                } {
                    nextiter:
                    for (int a2 = 0; a2 <= 100; a2++) {
                        for (int i = 0; i < 3; i++) {
                            if (c[i][0] - a0 == c[i][1] - a1 && c[i][1] - a1 == c[i][2] - a2) {

                            } else {
                                continue nextiter;
                            }
                        }
                        out.println("Yes");
                        return;

                    }
                } out.println("No") out.println out "No" int testNumber testNumber InputReader in in PrintWriter out out static class InputReader {
        final InputStream is;
        final byte[] buffer = new byte[1024];
        int curCharIdx;
        int nChars;

        public InputReader(InputStream is) {
            this.is = is;
        }

        public int read() {
            if (curCharIdx >= nChars) {
                try {
                    curCharIdx = 0;
                    nChars = is.read(buffer);
                    if (nChars == -1) {
                        return -1;
                    }
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return buffer[curCharIdx++];
        }

        public int nextInt() {
            int sign = 1;
            int c = skipDelims();
            if (c == '-') {
                sign = -1;
                c = read();
                if (isDelim(c)) {
                    throw new RuntimeException("Incorrect format");
                }
            }
            int val = 0;
            while (c != -1 && !isDelim(c)) {
                if (!isDigit(c)) {
                    throw new RuntimeException("Incorrect format");
                }
                val = 10 * val + (c - '0');
                c = read();
            }
            return val * sign;
        }

        private final int skipDelims() {
            int c = read();
            while (isDelim(c)) {
                c = read();
            }
            return c;
        }

        private static boolean isDelim(final int c) {
            return c == ' ' ||
                   c == '\n' ||
                   c == '\t' ||
                   c == '\r' ||
                   c == '\f';
        }

        private static boolean isDigit(final int c) {
            return '0' <= c && c <= '9';
        }

    } InputReader final InputStream is; is final byte[] buffer = new byte[1024]; buffer new byte[1024] 1024 int curCharIdx; curCharIdx int nChars; nChars public InputReader(InputStream is) {
            this.is = is;
        } InputReader {
            this.is = is;
        } this.is = is this.is this this.is is InputStream is is public int read() {
            if (curCharIdx >= nChars) {
                try {
                    curCharIdx = 0;
                    nChars = is.read(buffer);
                    if (nChars == -1) {
                        return -1;
                    }
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return buffer[curCharIdx++];
        } read {
            if (curCharIdx >= nChars) {
                try {
                    curCharIdx = 0;
                    nChars = is.read(buffer);
                    if (nChars == -1) {
                        return -1;
                    }
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return buffer[curCharIdx++];
        } if (curCharIdx >= nChars) {
                try {
                    curCharIdx = 0;
                    nChars = is.read(buffer);
                    if (nChars == -1) {
                        return -1;
                    }
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            } curCharIdx >= nChars curCharIdx nChars {
                try {
                    curCharIdx = 0;
                    nChars = is.read(buffer);
                    if (nChars == -1) {
                        return -1;
                    }
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            } try {
                    curCharIdx = 0;
                    nChars = is.read(buffer);
                    if (nChars == -1) {
                        return -1;
                    }
                } 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) {
                    curCharIdx = 0;
                    nChars = is.read(buffer);
                    if (nChars == -1) {
                        return -1;
                    }
                } curCharIdx = 0 curCharIdx 0 nChars = is.read(buffer) nChars is.read(buffer) is.read is buffer if (nChars == -1) {
                        return -1;
                    } nChars == -1 nChars -1 1 {
                        return -1;
                    } return -1; -1 1 return buffer[curCharIdx++]; buffer[curCharIdx++] buffer curCharIdx++ curCharIdx public int nextInt() {
            int sign = 1;
            int c = skipDelims();
            if (c == '-') {
                sign = -1;
                c = read();
                if (isDelim(c)) {
                    throw new RuntimeException("Incorrect format");
                }
            }
            int val = 0;
            while (c != -1 && !isDelim(c)) {
                if (!isDigit(c)) {
                    throw new RuntimeException("Incorrect format");
                }
                val = 10 * val + (c - '0');
                c = read();
            }
            return val * sign;
        } nextInt {
            int sign = 1;
            int c = skipDelims();
            if (c == '-') {
                sign = -1;
                c = read();
                if (isDelim(c)) {
                    throw new RuntimeException("Incorrect format");
                }
            }
            int val = 0;
            while (c != -1 && !isDelim(c)) {
                if (!isDigit(c)) {
                    throw new RuntimeException("Incorrect format");
                }
                val = 10 * val + (c - '0');
                c = read();
            }
            return val * sign;
        } int sign = 1; sign 1 int c = skipDelims(); c skipDelims() skipDelims if (c == '-') {
                sign = -1;
                c = read();
                if (isDelim(c)) {
                    throw new RuntimeException("Incorrect format");
                }
            } c == '-' c '-' {
                sign = -1;
                c = read();
                if (isDelim(c)) {
                    throw new RuntimeException("Incorrect format");
                }
            } sign = -1 sign -1 1 c = read() c read() read if (isDelim(c)) {
                    throw new RuntimeException("Incorrect format");
                } isDelim(c) isDelim c {
                    throw new RuntimeException("Incorrect format");
                } throw new RuntimeException("Incorrect format"); new RuntimeException("Incorrect format") int val = 0; val 0 while (c != -1 && !isDelim(c)) {
                if (!isDigit(c)) {
                    throw new RuntimeException("Incorrect format");
                }
                val = 10 * val + (c - '0');
                c = read();
            } c != -1 && !isDelim(c) c != -1 c -1 1 !isDelim(c) isDelim(c) isDelim c {
                if (!isDigit(c)) {
                    throw new RuntimeException("Incorrect format");
                }
                val = 10 * val + (c - '0');
                c = read();
            } if (!isDigit(c)) {
                    throw new RuntimeException("Incorrect format");
                } !isDigit(c) isDigit(c) isDigit c {
                    throw new RuntimeException("Incorrect format");
                } throw new RuntimeException("Incorrect format"); new RuntimeException("Incorrect format") val = 10 * val + (c - '0') val 10 * val + (c - '0') 10 * val 10 val (c - '0') c '0' c = read() c read() read return val * sign; val * sign val sign private final int skipDelims() {
            int c = read();
            while (isDelim(c)) {
                c = read();
            }
            return c;
        } skipDelims {
            int c = read();
            while (isDelim(c)) {
                c = read();
            }
            return c;
        } int c = read(); c read() read while (isDelim(c)) {
                c = read();
            } isDelim(c) isDelim c {
                c = read();
            } c = read() c read() read return c; c private static boolean isDelim(final int c) {
            return c == ' ' ||
                   c == '\n' ||
                   c == '\t' ||
                   c == '\r' ||
                   c == '\f';
        } isDelim {
            return c == ' ' ||
                   c == '\n' ||
                   c == '\t' ||
                   c == '\r' ||
                   c == '\f';
        } return c == ' ' ||
                   c == '\n' ||
                   c == '\t' ||
                   c == '\r' ||
                   c == '\f'; c == ' ' ||
                   c == '\n' ||
                   c == '\t' ||
                   c == '\r' ||
                   c == '\f' c == '\r' c == '\t' c == ' ' ||
                   c == '\n' ||
                   c == '\t' ||
                   c == '\r' ||
                   c == '\f' c == ' ' c ' ' c == '\n' c '\n' c == '\t' c '\t' c == '\r' c '\r' c == '\f' c '\f' final int c c private static boolean isDigit(final int c) {
            return '0' <= c && c <= '9';
        } isDigit {
            return '0' <= c && c <= '9';
        } return '0' <= c && c <= '9'; '0' <= c && c <= '9' '0' <= c '0' c c <= '9' c '9' final int c c 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++) {
                for (int j = 0; j < 3; j++) {
                    c[i][j] = in.nextInt();
                }
            }

            for (int a0 = 0; a0 <= 100; a0++) {
                for (int a1 = 0; a1 <= 100; a1++) {
                    nextiter:
                    for (int a2 = 0; a2 <= 100; a2++) {
                        for (int i = 0; i < 3; i++) {
                            if (c[i][0] - a0 == c[i][1] - a1 && c[i][1] - a1 == c[i][2] - a2) {

                            } else {
                                continue nextiter;
                            }
                        }
                        out.println("Yes");
                        return;

                    }
                }
            }
            out.println("No");
        }

    }

    static class InputReader {
        final InputStream is;
        final byte[] buffer = new byte[1024];
        int curCharIdx;
        int nChars;

        public InputReader(InputStream is) {
            this.is = is;
        }

        public int read() {
            if (curCharIdx >= nChars) {
                try {
                    curCharIdx = 0;
                    nChars = is.read(buffer);
                    if (nChars == -1) {
                        return -1;
                    }
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return buffer[curCharIdx++];
        }

        public int nextInt() {
            int sign = 1;
            int c = skipDelims();
            if (c == '-') {
                sign = -1;
                c = read();
                if (isDelim(c)) {
                    throw new RuntimeException("Incorrect format");
                }
            }
            int val = 0;
            while (c != -1 && !isDelim(c)) {
                if (!isDigit(c)) {
                    throw new RuntimeException("Incorrect format");
                }
                val = 10 * val + (c - '0');
                c = read();
            }
            return val * sign;
        }

        private final int skipDelims() {
            int c = read();
            while (isDelim(c)) {
                c = read();
            }
            return c;
        }

        private static boolean isDelim(final int c) {
            return c == ' ' ||
                   c == '\n' ||
                   c == '\t' ||
                   c == '\r' ||
                   c == '\f';
        }

        private static boolean isDigit(final int c) {
            return '0' <= c && c <= '9';
        }

    }
} 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++) {
                for (int j = 0; j < 3; j++) {
                    c[i][j] = in.nextInt();
                }
            }

            for (int a0 = 0; a0 <= 100; a0++) {
                for (int a1 = 0; a1 <= 100; a1++) {
                    nextiter:
                    for (int a2 = 0; a2 <= 100; a2++) {
                        for (int i = 0; i < 3; i++) {
                            if (c[i][0] - a0 == c[i][1] - a1 && c[i][1] - a1 == c[i][2] - a2) {

                            } else {
                                continue nextiter;
                            }
                        }
                        out.println("Yes");
                        return;

                    }
                }
            }
            out.println("No");
        }

    }

    static class InputReader {
        final InputStream is;
        final byte[] buffer = new byte[1024];
        int curCharIdx;
        int nChars;

        public InputReader(InputStream is) {
            this.is = is;
        }

        public int read() {
            if (curCharIdx >= nChars) {
                try {
                    curCharIdx = 0;
                    nChars = is.read(buffer);
                    if (nChars == -1) {
                        return -1;
                    }
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return buffer[curCharIdx++];
        }

        public int nextInt() {
            int sign = 1;
            int c = skipDelims();
            if (c == '-') {
                sign = -1;
                c = read();
                if (isDelim(c)) {
                    throw new RuntimeException("Incorrect format");
                }
            }
            int val = 0;
            while (c != -1 && !isDelim(c)) {
                if (!isDigit(c)) {
                    throw new RuntimeException("Incorrect format");
                }
                val = 10 * val + (c - '0');
                c = read();
            }
            return val * sign;
        }

        private final int skipDelims() {
            int c = read();
            while (isDelim(c)) {
                c = read();
            }
            return c;
        }

        private static boolean isDelim(final int c) {
            return c == ' ' ||
                   c == '\n' ||
                   c == '\t' ||
                   c == '\r' ||
                   c == '\f';
        }

        private static boolean isDigit(final int c) {
            return '0' <= c && c <= '9';
        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.IOException;
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++) {
                for (int j = 0; j < 3; j++) {
                    c[i][j] = in.nextInt();
                }
            }

            for (int a0 = 0; a0 <= 100; a0++) {
                for (int a1 = 0; a1 <= 100; a1++) {
                    nextiter:
                    for (int a2 = 0; a2 <= 100; a2++) {
                        for (int i = 0; i < 3; i++) {
                            if (c[i][0] - a0 == c[i][1] - a1 && c[i][1] - a1 == c[i][2] - a2) {

                            } else {
                                continue nextiter;
                            }
                        }
                        out.println("Yes");
                        return;

                    }
                }
            }
            out.println("No");
        }

    }

    static class InputReader {
        final InputStream is;
        final byte[] buffer = new byte[1024];
        int curCharIdx;
        int nChars;

        public InputReader(InputStream is) {
            this.is = is;
        }

        public int read() {
            if (curCharIdx >= nChars) {
                try {
                    curCharIdx = 0;
                    nChars = is.read(buffer);
                    if (nChars == -1) {
                        return -1;
                    }
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return buffer[curCharIdx++];
        }

        public int nextInt() {
            int sign = 1;
            int c = skipDelims();
            if (c == '-') {
                sign = -1;
                c = read();
                if (isDelim(c)) {
                    throw new RuntimeException("Incorrect format");
                }
            }
            int val = 0;
            while (c != -1 && !isDelim(c)) {
                if (!isDigit(c)) {
                    throw new RuntimeException("Incorrect format");
                }
                val = 10 * val + (c - '0');
                c = read();
            }
            return val * sign;
        }

        private final int skipDelims() {
            int c = read();
            while (isDelim(c)) {
                c = read();
            }
            return c;
        }

        private static boolean isDelim(final int c) {
            return c == ' ' ||
                   c == '\n' ||
                   c == '\t' ||
                   c == '\r' ||
                   c == '\f';
        }

        private static boolean isDigit(final int c) {
            return '0' <= c && c <= '9';
        }

    }
}

