import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.NoSuchElementException;
import java.util.StringJoiner;

class Main {

    static PrintWriter out;
    static InputReader sc;

    public static void main(String[] args) {
        sc = new InputReader(System.in);
        out = new PrintWriter(System.out);
        solve();
        out.flush();
    }

    static void solve() {
        int[][] c = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c[i][j] = sc.nextInt();
            }
        }
        int[] a = new int[3];
        int[] b = new int[3];
        for (int i = 0; i <= 100; i++) {
            for (int j = 0; j <= 100; j++) {
                Loop: for (int k = 0; k <= 100; k++) {
                    a[0] = i;
                    a[1] = j;
                    a[2] = k;
                    for (int l = 0; l < 3; l++) {
                        b[l] = c[0][l] - a[0];
                    }
                    for (int l = 1; l < 3; l++) {
                        for (int m = 0; m < 3; m++) {
                            if (c[l][m] != a[l] + b[m]) {
                                continue Loop;
                            }
                        }
                    }
                    out.println("Yes");
                    return;
                }
            }
        }
        out.println("No");
    }

    static void debug(Object... args) {
        StringJoiner j = new StringJoiner(" ");
        for (Object arg : args) {
            Class<?> type = arg.getClass();
            if (type.getComponentType().isArray()) {
                for (Object o : (Object[]) arg) {
                    debug(o);
                }
            } else if (arg instanceof int[]) {
                j.add(Arrays.toString((int[]) arg));
            } else if (arg instanceof long[]) {
                j.add(Arrays.toString((long[]) arg));
            } else if (arg instanceof double[]) {
                j.add(Arrays.toString((double[]) arg));
            } else if (arg instanceof char[]) {
                j.add(Arrays.toString((char[]) arg));
            } else if (arg instanceof boolean[]) {
                j.add(Arrays.toString((boolean[]) arg));
            } else if (arg instanceof Object[]) {
                j.add(Arrays.toString((Object[]) arg));
            } else {
                j.add(arg.toString());
            }
        }
        System.err.println(j.toString());
    }

    static class InputReader {

        private InputStream in;
        private byte[] buffer = new byte[1024];
        private int curbuf;
        private int lenbuf;

        public InputReader(InputStream in) {
            this.in = in;
            this.curbuf = this.lenbuf = 0;
        }

        public boolean hasNextByte() {
            if (this.curbuf >= this.lenbuf) {
                this.curbuf = 0;
                try {
                    this.lenbuf = this.in.read(this.buffer);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (this.lenbuf <= 0) {
                    return false;
                }
            }
            return true;
        }

        private int readByte() {
            if (this.hasNextByte()) {
                return this.buffer[this.curbuf++];
            } else {
                return -1;
            }
        }

        private boolean isSpaceChar(int c) {
            return !(c >= 33 && c <= 126);
        }

        private void skip() {
            while (this.hasNextByte() && this.isSpaceChar(this.buffer[this.curbuf])) {
                this.curbuf++;
            }
        }

        public boolean hasNext() {
            this.skip();
            return this.hasNextByte();
        }

        public String next() {
            if (!this.hasNext()) {
                throw new NoSuchElementException();
            }
            StringBuilder sb = new StringBuilder();
            int b = this.readByte();
            while (!this.isSpaceChar(b)) {
                sb.appendCodePoint(b);
                b = this.readByte();
            }
            return sb.toString();
        }

        public int nextInt() {
            if (!this.hasNext()) {
                throw new NoSuchElementException();
            }
            int c = this.readByte();
            while (this.isSpaceChar(c)) {
                c = this.readByte();
            }
            boolean minus = false;
            if (c == '-') {
                minus = true;
                c = this.readByte();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res = res * 10 + c - '0';
                c = this.readByte();
            } while (!this.isSpaceChar(c));
            return minus ? -res : res;
        }

        public long nextLong() {
            if (!this.hasNext()) {
                throw new NoSuchElementException();
            }
            int c = this.readByte();
            while (this.isSpaceChar(c)) {
                c = this.readByte();
            }
            boolean minus = false;
            if (c == '-') {
                minus = true;
                c = this.readByte();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res = res * 10 + c - '0';
                c = this.readByte();
            } while (!this.isSpaceChar(c));
            return minus ? -res : res;
        }

        public double nextDouble() {
            return Double.parseDouble(this.next());
        }

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

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

        public char[][] nextCharMap(int n, int m) {
            char[][] map = new char[n][m];
            for (int i = 0; i < n; i++) {
                map[i] = this.next().toCharArray();
            }
            return map;
        }
    }
} import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.Arrays; Arrays java.util import java.util.InputMismatchException; InputMismatchException java.util import java.util.NoSuchElementException; NoSuchElementException java.util import java.util.StringJoiner; StringJoiner java.util class Main {

    static PrintWriter out;
    static InputReader sc;

    public static void main(String[] args) {
        sc = new InputReader(System.in);
        out = new PrintWriter(System.out);
        solve();
        out.flush();
    }

    static void solve() {
        int[][] c = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c[i][j] = sc.nextInt();
            }
        }
        int[] a = new int[3];
        int[] b = new int[3];
        for (int i = 0; i <= 100; i++) {
            for (int j = 0; j <= 100; j++) {
                Loop: for (int k = 0; k <= 100; k++) {
                    a[0] = i;
                    a[1] = j;
                    a[2] = k;
                    for (int l = 0; l < 3; l++) {
                        b[l] = c[0][l] - a[0];
                    }
                    for (int l = 1; l < 3; l++) {
                        for (int m = 0; m < 3; m++) {
                            if (c[l][m] != a[l] + b[m]) {
                                continue Loop;
                            }
                        }
                    }
                    out.println("Yes");
                    return;
                }
            }
        }
        out.println("No");
    }

    static void debug(Object... args) {
        StringJoiner j = new StringJoiner(" ");
        for (Object arg : args) {
            Class<?> type = arg.getClass();
            if (type.getComponentType().isArray()) {
                for (Object o : (Object[]) arg) {
                    debug(o);
                }
            } else if (arg instanceof int[]) {
                j.add(Arrays.toString((int[]) arg));
            } else if (arg instanceof long[]) {
                j.add(Arrays.toString((long[]) arg));
            } else if (arg instanceof double[]) {
                j.add(Arrays.toString((double[]) arg));
            } else if (arg instanceof char[]) {
                j.add(Arrays.toString((char[]) arg));
            } else if (arg instanceof boolean[]) {
                j.add(Arrays.toString((boolean[]) arg));
            } else if (arg instanceof Object[]) {
                j.add(Arrays.toString((Object[]) arg));
            } else {
                j.add(arg.toString());
            }
        }
        System.err.println(j.toString());
    }

    static class InputReader {

        private InputStream in;
        private byte[] buffer = new byte[1024];
        private int curbuf;
        private int lenbuf;

        public InputReader(InputStream in) {
            this.in = in;
            this.curbuf = this.lenbuf = 0;
        }

        public boolean hasNextByte() {
            if (this.curbuf >= this.lenbuf) {
                this.curbuf = 0;
                try {
                    this.lenbuf = this.in.read(this.buffer);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (this.lenbuf <= 0) {
                    return false;
                }
            }
            return true;
        }

        private int readByte() {
            if (this.hasNextByte()) {
                return this.buffer[this.curbuf++];
            } else {
                return -1;
            }
        }

        private boolean isSpaceChar(int c) {
            return !(c >= 33 && c <= 126);
        }

        private void skip() {
            while (this.hasNextByte() && this.isSpaceChar(this.buffer[this.curbuf])) {
                this.curbuf++;
            }
        }

        public boolean hasNext() {
            this.skip();
            return this.hasNextByte();
        }

        public String next() {
            if (!this.hasNext()) {
                throw new NoSuchElementException();
            }
            StringBuilder sb = new StringBuilder();
            int b = this.readByte();
            while (!this.isSpaceChar(b)) {
                sb.appendCodePoint(b);
                b = this.readByte();
            }
            return sb.toString();
        }

        public int nextInt() {
            if (!this.hasNext()) {
                throw new NoSuchElementException();
            }
            int c = this.readByte();
            while (this.isSpaceChar(c)) {
                c = this.readByte();
            }
            boolean minus = false;
            if (c == '-') {
                minus = true;
                c = this.readByte();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res = res * 10 + c - '0';
                c = this.readByte();
            } while (!this.isSpaceChar(c));
            return minus ? -res : res;
        }

        public long nextLong() {
            if (!this.hasNext()) {
                throw new NoSuchElementException();
            }
            int c = this.readByte();
            while (this.isSpaceChar(c)) {
                c = this.readByte();
            }
            boolean minus = false;
            if (c == '-') {
                minus = true;
                c = this.readByte();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res = res * 10 + c - '0';
                c = this.readByte();
            } while (!this.isSpaceChar(c));
            return minus ? -res : res;
        }

        public double nextDouble() {
            return Double.parseDouble(this.next());
        }

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

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

        public char[][] nextCharMap(int n, int m) {
            char[][] map = new char[n][m];
            for (int i = 0; i < n; i++) {
                map[i] = this.next().toCharArray();
            }
            return map;
        }
    }
} Main static PrintWriter out; out static InputReader sc; sc public static void main(String[] args) {
        sc = new InputReader(System.in);
        out = new PrintWriter(System.out);
        solve();
        out.flush();
    } main {
        sc = new InputReader(System.in);
        out = new PrintWriter(System.out);
        solve();
        out.flush();
    } sc = new InputReader(System.in) sc new InputReader(System.in) out = new PrintWriter(System.out) out new PrintWriter(System.out) solve() solve out.flush() out.flush out String[] args args static void solve() {
        int[][] c = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c[i][j] = sc.nextInt();
            }
        }
        int[] a = new int[3];
        int[] b = new int[3];
        for (int i = 0; i <= 100; i++) {
            for (int j = 0; j <= 100; j++) {
                Loop: for (int k = 0; k <= 100; k++) {
                    a[0] = i;
                    a[1] = j;
                    a[2] = k;
                    for (int l = 0; l < 3; l++) {
                        b[l] = c[0][l] - a[0];
                    }
                    for (int l = 1; l < 3; l++) {
                        for (int m = 0; m < 3; m++) {
                            if (c[l][m] != a[l] + b[m]) {
                                continue Loop;
                            }
                        }
                    }
                    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] = sc.nextInt();
            }
        }
        int[] a = new int[3];
        int[] b = new int[3];
        for (int i = 0; i <= 100; i++) {
            for (int j = 0; j <= 100; j++) {
                Loop: for (int k = 0; k <= 100; k++) {
                    a[0] = i;
                    a[1] = j;
                    a[2] = k;
                    for (int l = 0; l < 3; l++) {
                        b[l] = c[0][l] - a[0];
                    }
                    for (int l = 1; l < 3; l++) {
                        for (int m = 0; m < 3; m++) {
                            if (c[l][m] != a[l] + b[m]) {
                                continue Loop;
                            }
                        }
                    }
                    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] = sc.nextInt();
            }
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            for (int j = 0; j < 3; j++) {
                c[i][j] = sc.nextInt();
            }
        } {
            for (int j = 0; j < 3; j++) {
                c[i][j] = sc.nextInt();
            }
        } for (int j = 0; j < 3; j++) {
                c[i][j] = sc.nextInt();
            } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
                c[i][j] = sc.nextInt();
            } {
                c[i][j] = sc.nextInt();
            } c[i][j] = sc.nextInt() c[i][j] c[i] c i j sc.nextInt() sc.nextInt sc int[] a = new int[3]; a new int[3] 3 int[] b = new int[3]; b new int[3] 3 for (int i = 0; i <= 100; i++) {
            for (int j = 0; j <= 100; j++) {
                Loop: for (int k = 0; k <= 100; k++) {
                    a[0] = i;
                    a[1] = j;
                    a[2] = k;
                    for (int l = 0; l < 3; l++) {
                        b[l] = c[0][l] - a[0];
                    }
                    for (int l = 1; l < 3; l++) {
                        for (int m = 0; m < 3; m++) {
                            if (c[l][m] != a[l] + b[m]) {
                                continue Loop;
                            }
                        }
                    }
                    out.println("Yes");
                    return;
                }
            }
        } int i = 0; int i = 0; i 0 i <= 100 i 100 i++ i++ i {
            for (int j = 0; j <= 100; j++) {
                Loop: for (int k = 0; k <= 100; k++) {
                    a[0] = i;
                    a[1] = j;
                    a[2] = k;
                    for (int l = 0; l < 3; l++) {
                        b[l] = c[0][l] - a[0];
                    }
                    for (int l = 1; l < 3; l++) {
                        for (int m = 0; m < 3; m++) {
                            if (c[l][m] != a[l] + b[m]) {
                                continue Loop;
                            }
                        }
                    }
                    out.println("Yes");
                    return;
                }
            }
        } {
            for (int j = 0; j <= 100; j++) {
                Loop: for (int k = 0; k <= 100; k++) {
                    a[0] = i;
                    a[1] = j;
                    a[2] = k;
                    for (int l = 0; l < 3; l++) {
                        b[l] = c[0][l] - a[0];
                    }
                    for (int l = 1; l < 3; l++) {
                        for (int m = 0; m < 3; m++) {
                            if (c[l][m] != a[l] + b[m]) {
                                continue Loop;
                            }
                        }
                    }
                    out.println("Yes");
                    return;
                }
            }
        } for (int j = 0; j <= 100; j++) {
                Loop: for (int k = 0; k <= 100; k++) {
                    a[0] = i;
                    a[1] = j;
                    a[2] = k;
                    for (int l = 0; l < 3; l++) {
                        b[l] = c[0][l] - a[0];
                    }
                    for (int l = 1; l < 3; l++) {
                        for (int m = 0; m < 3; m++) {
                            if (c[l][m] != a[l] + b[m]) {
                                continue Loop;
                            }
                        }
                    }
                    out.println("Yes");
                    return;
                }
            } int j = 0; int j = 0; j 0 j <= 100 j 100 j++ j++ j {
                Loop: for (int k = 0; k <= 100; k++) {
                    a[0] = i;
                    a[1] = j;
                    a[2] = k;
                    for (int l = 0; l < 3; l++) {
                        b[l] = c[0][l] - a[0];
                    }
                    for (int l = 1; l < 3; l++) {
                        for (int m = 0; m < 3; m++) {
                            if (c[l][m] != a[l] + b[m]) {
                                continue Loop;
                            }
                        }
                    }
                    out.println("Yes");
                    return;
                }
            } {
                Loop: for (int k = 0; k <= 100; k++) {
                    a[0] = i;
                    a[1] = j;
                    a[2] = k;
                    for (int l = 0; l < 3; l++) {
                        b[l] = c[0][l] - a[0];
                    }
                    for (int l = 1; l < 3; l++) {
                        for (int m = 0; m < 3; m++) {
                            if (c[l][m] != a[l] + b[m]) {
                                continue Loop;
                            }
                        }
                    }
                    out.println("Yes");
                    return;
                }
            } out.println("No") out.println out "No" static void debug(Object... args) {
        StringJoiner j = new StringJoiner(" ");
        for (Object arg : args) {
            Class<?> type = arg.getClass();
            if (type.getComponentType().isArray()) {
                for (Object o : (Object[]) arg) {
                    debug(o);
                }
            } else if (arg instanceof int[]) {
                j.add(Arrays.toString((int[]) arg));
            } else if (arg instanceof long[]) {
                j.add(Arrays.toString((long[]) arg));
            } else if (arg instanceof double[]) {
                j.add(Arrays.toString((double[]) arg));
            } else if (arg instanceof char[]) {
                j.add(Arrays.toString((char[]) arg));
            } else if (arg instanceof boolean[]) {
                j.add(Arrays.toString((boolean[]) arg));
            } else if (arg instanceof Object[]) {
                j.add(Arrays.toString((Object[]) arg));
            } else {
                j.add(arg.toString());
            }
        }
        System.err.println(j.toString());
    } debug {
        StringJoiner j = new StringJoiner(" ");
        for (Object arg : args) {
            Class<?> type = arg.getClass();
            if (type.getComponentType().isArray()) {
                for (Object o : (Object[]) arg) {
                    debug(o);
                }
            } else if (arg instanceof int[]) {
                j.add(Arrays.toString((int[]) arg));
            } else if (arg instanceof long[]) {
                j.add(Arrays.toString((long[]) arg));
            } else if (arg instanceof double[]) {
                j.add(Arrays.toString((double[]) arg));
            } else if (arg instanceof char[]) {
                j.add(Arrays.toString((char[]) arg));
            } else if (arg instanceof boolean[]) {
                j.add(Arrays.toString((boolean[]) arg));
            } else if (arg instanceof Object[]) {
                j.add(Arrays.toString((Object[]) arg));
            } else {
                j.add(arg.toString());
            }
        }
        System.err.println(j.toString());
    } StringJoiner j = new StringJoiner(" "); j new StringJoiner(" ") for (Object arg : args) {
            Class<?> type = arg.getClass();
            if (type.getComponentType().isArray()) {
                for (Object o : (Object[]) arg) {
                    debug(o);
                }
            } else if (arg instanceof int[]) {
                j.add(Arrays.toString((int[]) arg));
            } else if (arg instanceof long[]) {
                j.add(Arrays.toString((long[]) arg));
            } else if (arg instanceof double[]) {
                j.add(Arrays.toString((double[]) arg));
            } else if (arg instanceof char[]) {
                j.add(Arrays.toString((char[]) arg));
            } else if (arg instanceof boolean[]) {
                j.add(Arrays.toString((boolean[]) arg));
            } else if (arg instanceof Object[]) {
                j.add(Arrays.toString((Object[]) arg));
            } else {
                j.add(arg.toString());
            }
        } Object arg args {
            Class<?> type = arg.getClass();
            if (type.getComponentType().isArray()) {
                for (Object o : (Object[]) arg) {
                    debug(o);
                }
            } else if (arg instanceof int[]) {
                j.add(Arrays.toString((int[]) arg));
            } else if (arg instanceof long[]) {
                j.add(Arrays.toString((long[]) arg));
            } else if (arg instanceof double[]) {
                j.add(Arrays.toString((double[]) arg));
            } else if (arg instanceof char[]) {
                j.add(Arrays.toString((char[]) arg));
            } else if (arg instanceof boolean[]) {
                j.add(Arrays.toString((boolean[]) arg));
            } else if (arg instanceof Object[]) {
                j.add(Arrays.toString((Object[]) arg));
            } else {
                j.add(arg.toString());
            }
        } {
            Class<?> type = arg.getClass();
            if (type.getComponentType().isArray()) {
                for (Object o : (Object[]) arg) {
                    debug(o);
                }
            } else if (arg instanceof int[]) {
                j.add(Arrays.toString((int[]) arg));
            } else if (arg instanceof long[]) {
                j.add(Arrays.toString((long[]) arg));
            } else if (arg instanceof double[]) {
                j.add(Arrays.toString((double[]) arg));
            } else if (arg instanceof char[]) {
                j.add(Arrays.toString((char[]) arg));
            } else if (arg instanceof boolean[]) {
                j.add(Arrays.toString((boolean[]) arg));
            } else if (arg instanceof Object[]) {
                j.add(Arrays.toString((Object[]) arg));
            } else {
                j.add(arg.toString());
            }
        } Class<?> type = arg.getClass(); type arg.getClass() arg.getClass arg if (type.getComponentType().isArray()) {
                for (Object o : (Object[]) arg) {
                    debug(o);
                }
            } else if (arg instanceof int[]) {
                j.add(Arrays.toString((int[]) arg));
            } else if (arg instanceof long[]) {
                j.add(Arrays.toString((long[]) arg));
            } else if (arg instanceof double[]) {
                j.add(Arrays.toString((double[]) arg));
            } else if (arg instanceof char[]) {
                j.add(Arrays.toString((char[]) arg));
            } else if (arg instanceof boolean[]) {
                j.add(Arrays.toString((boolean[]) arg));
            } else if (arg instanceof Object[]) {
                j.add(Arrays.toString((Object[]) arg));
            } else {
                j.add(arg.toString());
            } type.getComponentType().isArray() type.getComponentType().isArray type.getComponentType() type.getComponentType type {
                for (Object o : (Object[]) arg) {
                    debug(o);
                }
            } for (Object o : (Object[]) arg) {
                    debug(o);
                } Object o (Object[]) arg {
                    debug(o);
                } {
                    debug(o);
                } debug(o) debug o if (arg instanceof int[]) {
                j.add(Arrays.toString((int[]) arg));
            } else if (arg instanceof long[]) {
                j.add(Arrays.toString((long[]) arg));
            } else if (arg instanceof double[]) {
                j.add(Arrays.toString((double[]) arg));
            } else if (arg instanceof char[]) {
                j.add(Arrays.toString((char[]) arg));
            } else if (arg instanceof boolean[]) {
                j.add(Arrays.toString((boolean[]) arg));
            } else if (arg instanceof Object[]) {
                j.add(Arrays.toString((Object[]) arg));
            } else {
                j.add(arg.toString());
            } arg instanceof int[] arg int[] {
                j.add(Arrays.toString((int[]) arg));
            } j.add(Arrays.toString((int[]) arg)) j.add j Arrays.toString((int[]) arg) Arrays.toString Arrays (int[]) arg if (arg instanceof long[]) {
                j.add(Arrays.toString((long[]) arg));
            } else if (arg instanceof double[]) {
                j.add(Arrays.toString((double[]) arg));
            } else if (arg instanceof char[]) {
                j.add(Arrays.toString((char[]) arg));
            } else if (arg instanceof boolean[]) {
                j.add(Arrays.toString((boolean[]) arg));
            } else if (arg instanceof Object[]) {
                j.add(Arrays.toString((Object[]) arg));
            } else {
                j.add(arg.toString());
            } arg instanceof long[] arg long[] {
                j.add(Arrays.toString((long[]) arg));
            } j.add(Arrays.toString((long[]) arg)) j.add j Arrays.toString((long[]) arg) Arrays.toString Arrays (long[]) arg if (arg instanceof double[]) {
                j.add(Arrays.toString((double[]) arg));
            } else if (arg instanceof char[]) {
                j.add(Arrays.toString((char[]) arg));
            } else if (arg instanceof boolean[]) {
                j.add(Arrays.toString((boolean[]) arg));
            } else if (arg instanceof Object[]) {
                j.add(Arrays.toString((Object[]) arg));
            } else {
                j.add(arg.toString());
            } arg instanceof double[] arg double[] {
                j.add(Arrays.toString((double[]) arg));
            } j.add(Arrays.toString((double[]) arg)) j.add j Arrays.toString((double[]) arg) Arrays.toString Arrays (double[]) arg if (arg instanceof char[]) {
                j.add(Arrays.toString((char[]) arg));
            } else if (arg instanceof boolean[]) {
                j.add(Arrays.toString((boolean[]) arg));
            } else if (arg instanceof Object[]) {
                j.add(Arrays.toString((Object[]) arg));
            } else {
                j.add(arg.toString());
            } arg instanceof char[] arg char[] {
                j.add(Arrays.toString((char[]) arg));
            } j.add(Arrays.toString((char[]) arg)) j.add j Arrays.toString((char[]) arg) Arrays.toString Arrays (char[]) arg if (arg instanceof boolean[]) {
                j.add(Arrays.toString((boolean[]) arg));
            } else if (arg instanceof Object[]) {
                j.add(Arrays.toString((Object[]) arg));
            } else {
                j.add(arg.toString());
            } arg instanceof boolean[] arg boolean[] {
                j.add(Arrays.toString((boolean[]) arg));
            } j.add(Arrays.toString((boolean[]) arg)) j.add j Arrays.toString((boolean[]) arg) Arrays.toString Arrays (boolean[]) arg if (arg instanceof Object[]) {
                j.add(Arrays.toString((Object[]) arg));
            } else {
                j.add(arg.toString());
            } arg instanceof Object[] arg Object[] {
                j.add(Arrays.toString((Object[]) arg));
            } j.add(Arrays.toString((Object[]) arg)) j.add j Arrays.toString((Object[]) arg) Arrays.toString Arrays (Object[]) arg {
                j.add(arg.toString());
            } j.add(arg.toString()) j.add j arg.toString() arg.toString arg System.err.println(j.toString()) System.err.println System.err System System.err j.toString() j.toString j Object... args args static class InputReader {

        private InputStream in;
        private byte[] buffer = new byte[1024];
        private int curbuf;
        private int lenbuf;

        public InputReader(InputStream in) {
            this.in = in;
            this.curbuf = this.lenbuf = 0;
        }

        public boolean hasNextByte() {
            if (this.curbuf >= this.lenbuf) {
                this.curbuf = 0;
                try {
                    this.lenbuf = this.in.read(this.buffer);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (this.lenbuf <= 0) {
                    return false;
                }
            }
            return true;
        }

        private int readByte() {
            if (this.hasNextByte()) {
                return this.buffer[this.curbuf++];
            } else {
                return -1;
            }
        }

        private boolean isSpaceChar(int c) {
            return !(c >= 33 && c <= 126);
        }

        private void skip() {
            while (this.hasNextByte() && this.isSpaceChar(this.buffer[this.curbuf])) {
                this.curbuf++;
            }
        }

        public boolean hasNext() {
            this.skip();
            return this.hasNextByte();
        }

        public String next() {
            if (!this.hasNext()) {
                throw new NoSuchElementException();
            }
            StringBuilder sb = new StringBuilder();
            int b = this.readByte();
            while (!this.isSpaceChar(b)) {
                sb.appendCodePoint(b);
                b = this.readByte();
            }
            return sb.toString();
        }

        public int nextInt() {
            if (!this.hasNext()) {
                throw new NoSuchElementException();
            }
            int c = this.readByte();
            while (this.isSpaceChar(c)) {
                c = this.readByte();
            }
            boolean minus = false;
            if (c == '-') {
                minus = true;
                c = this.readByte();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res = res * 10 + c - '0';
                c = this.readByte();
            } while (!this.isSpaceChar(c));
            return minus ? -res : res;
        }

        public long nextLong() {
            if (!this.hasNext()) {
                throw new NoSuchElementException();
            }
            int c = this.readByte();
            while (this.isSpaceChar(c)) {
                c = this.readByte();
            }
            boolean minus = false;
            if (c == '-') {
                minus = true;
                c = this.readByte();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res = res * 10 + c - '0';
                c = this.readByte();
            } while (!this.isSpaceChar(c));
            return minus ? -res : res;
        }

        public double nextDouble() {
            return Double.parseDouble(this.next());
        }

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

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

        public char[][] nextCharMap(int n, int m) {
            char[][] map = new char[n][m];
            for (int i = 0; i < n; i++) {
                map[i] = this.next().toCharArray();
            }
            return map;
        }
    } InputReader private InputStream in; in private byte[] buffer = new byte[1024]; buffer new byte[1024] 1024 private int curbuf; curbuf private int lenbuf; lenbuf public InputReader(InputStream in) {
            this.in = in;
            this.curbuf = this.lenbuf = 0;
        } InputReader {
            this.in = in;
            this.curbuf = this.lenbuf = 0;
        } this.in = in this.in this this.in in this.curbuf = this.lenbuf = 0 this.curbuf this this.curbuf this.lenbuf = 0 this.lenbuf this this.lenbuf 0 InputStream in in public boolean hasNextByte() {
            if (this.curbuf >= this.lenbuf) {
                this.curbuf = 0;
                try {
                    this.lenbuf = this.in.read(this.buffer);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (this.lenbuf <= 0) {
                    return false;
                }
            }
            return true;
        } hasNextByte {
            if (this.curbuf >= this.lenbuf) {
                this.curbuf = 0;
                try {
                    this.lenbuf = this.in.read(this.buffer);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (this.lenbuf <= 0) {
                    return false;
                }
            }
            return true;
        } if (this.curbuf >= this.lenbuf) {
                this.curbuf = 0;
                try {
                    this.lenbuf = this.in.read(this.buffer);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (this.lenbuf <= 0) {
                    return false;
                }
            } this.curbuf >= this.lenbuf this.curbuf this this.curbuf this.lenbuf this this.lenbuf {
                this.curbuf = 0;
                try {
                    this.lenbuf = this.in.read(this.buffer);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (this.lenbuf <= 0) {
                    return false;
                }
            } this.curbuf = 0 this.curbuf this this.curbuf 0 try {
                    this.lenbuf = this.in.read(this.buffer);
                } catch (IOException e) {
                    throw new InputMismatchException();
                } catch (IOException e) {
                    throw new InputMismatchException();
                } IOException e {
                    throw new InputMismatchException();
                } throw new InputMismatchException(); new InputMismatchException() {
                    this.lenbuf = this.in.read(this.buffer);
                } this.lenbuf = this.in.read(this.buffer) this.lenbuf this this.lenbuf this.in.read(this.buffer) this.in.read this.in this this.in this.buffer this this.buffer if (this.lenbuf <= 0) {
                    return false;
                } this.lenbuf <= 0 this.lenbuf this this.lenbuf 0 {
                    return false;
                } return false; false return true; true private int readByte() {
            if (this.hasNextByte()) {
                return this.buffer[this.curbuf++];
            } else {
                return -1;
            }
        } readByte {
            if (this.hasNextByte()) {
                return this.buffer[this.curbuf++];
            } else {
                return -1;
            }
        } if (this.hasNextByte()) {
                return this.buffer[this.curbuf++];
            } else {
                return -1;
            } this.hasNextByte() this.hasNextByte this {
                return this.buffer[this.curbuf++];
            } return this.buffer[this.curbuf++]; this.buffer[this.curbuf++] this.buffer this this.buffer this.curbuf++ this.curbuf this this.curbuf {
                return -1;
            } return -1; -1 1 private boolean isSpaceChar(int c) {
            return !(c >= 33 && c <= 126);
        } isSpaceChar {
            return !(c >= 33 && c <= 126);
        } return !(c >= 33 && c <= 126); !(c >= 33 && c <= 126) (c >= 33 && c <= 126) c >= 33 c 33 c <= 126 c 126 int c c private void skip() {
            while (this.hasNextByte() && this.isSpaceChar(this.buffer[this.curbuf])) {
                this.curbuf++;
            }
        } skip {
            while (this.hasNextByte() && this.isSpaceChar(this.buffer[this.curbuf])) {
                this.curbuf++;
            }
        } while (this.hasNextByte() && this.isSpaceChar(this.buffer[this.curbuf])) {
                this.curbuf++;
            } this.hasNextByte() && this.isSpaceChar(this.buffer[this.curbuf]) this.hasNextByte() this.hasNextByte this this.isSpaceChar(this.buffer[this.curbuf]) this.isSpaceChar this this.buffer[this.curbuf] this.buffer this this.buffer this.curbuf this this.curbuf {
                this.curbuf++;
            } this.curbuf++ this.curbuf this this.curbuf public boolean hasNext() {
            this.skip();
            return this.hasNextByte();
        } hasNext {
            this.skip();
            return this.hasNextByte();
        } this.skip() this.skip this return this.hasNextByte(); this.hasNextByte() this.hasNextByte this public String next() {
            if (!this.hasNext()) {
                throw new NoSuchElementException();
            }
            StringBuilder sb = new StringBuilder();
            int b = this.readByte();
            while (!this.isSpaceChar(b)) {
                sb.appendCodePoint(b);
                b = this.readByte();
            }
            return sb.toString();
        } next {
            if (!this.hasNext()) {
                throw new NoSuchElementException();
            }
            StringBuilder sb = new StringBuilder();
            int b = this.readByte();
            while (!this.isSpaceChar(b)) {
                sb.appendCodePoint(b);
                b = this.readByte();
            }
            return sb.toString();
        } if (!this.hasNext()) {
                throw new NoSuchElementException();
            } !this.hasNext() this.hasNext() this.hasNext this {
                throw new NoSuchElementException();
            } throw new NoSuchElementException(); new NoSuchElementException() StringBuilder sb = new StringBuilder(); sb new StringBuilder() int b = this.readByte(); b this.readByte() this.readByte this while (!this.isSpaceChar(b)) {
                sb.appendCodePoint(b);
                b = this.readByte();
            } !this.isSpaceChar(b) this.isSpaceChar(b) this.isSpaceChar this b {
                sb.appendCodePoint(b);
                b = this.readByte();
            } sb.appendCodePoint(b) sb.appendCodePoint sb b b = this.readByte() b this.readByte() this.readByte this return sb.toString(); sb.toString() sb.toString sb public int nextInt() {
            if (!this.hasNext()) {
                throw new NoSuchElementException();
            }
            int c = this.readByte();
            while (this.isSpaceChar(c)) {
                c = this.readByte();
            }
            boolean minus = false;
            if (c == '-') {
                minus = true;
                c = this.readByte();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res = res * 10 + c - '0';
                c = this.readByte();
            } while (!this.isSpaceChar(c));
            return minus ? -res : res;
        } nextInt {
            if (!this.hasNext()) {
                throw new NoSuchElementException();
            }
            int c = this.readByte();
            while (this.isSpaceChar(c)) {
                c = this.readByte();
            }
            boolean minus = false;
            if (c == '-') {
                minus = true;
                c = this.readByte();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res = res * 10 + c - '0';
                c = this.readByte();
            } while (!this.isSpaceChar(c));
            return minus ? -res : res;
        } if (!this.hasNext()) {
                throw new NoSuchElementException();
            } !this.hasNext() this.hasNext() this.hasNext this {
                throw new NoSuchElementException();
            } throw new NoSuchElementException(); new NoSuchElementException() int c = this.readByte(); c this.readByte() this.readByte this while (this.isSpaceChar(c)) {
                c = this.readByte();
            } this.isSpaceChar(c) this.isSpaceChar this c {
                c = this.readByte();
            } c = this.readByte() c this.readByte() this.readByte this boolean minus = false; minus false if (c == '-') {
                minus = true;
                c = this.readByte();
            } c == '-' c '-' {
                minus = true;
                c = this.readByte();
            } minus = true minus true c = this.readByte() c this.readByte() this.readByte this int res = 0; res 0 do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res = res * 10 + c - '0';
                c = this.readByte();
            } while (!this.isSpaceChar(c)); !this.isSpaceChar(c) this.isSpaceChar(c) this.isSpaceChar this c {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res = res * 10 + c - '0';
                c = this.readByte();
            } if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                } c < '0' || c > '9' c < '0' c '0' c > '9' c '9' {
                    throw new InputMismatchException();
                } throw new InputMismatchException(); new InputMismatchException() res = res * 10 + c - '0' res res * 10 + c - '0' res * 10 + c res * 10 res 10 c '0' c = this.readByte() c this.readByte() this.readByte this return minus ? -res : res; minus ? -res : res minus -res res res public long nextLong() {
            if (!this.hasNext()) {
                throw new NoSuchElementException();
            }
            int c = this.readByte();
            while (this.isSpaceChar(c)) {
                c = this.readByte();
            }
            boolean minus = false;
            if (c == '-') {
                minus = true;
                c = this.readByte();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res = res * 10 + c - '0';
                c = this.readByte();
            } while (!this.isSpaceChar(c));
            return minus ? -res : res;
        } nextLong {
            if (!this.hasNext()) {
                throw new NoSuchElementException();
            }
            int c = this.readByte();
            while (this.isSpaceChar(c)) {
                c = this.readByte();
            }
            boolean minus = false;
            if (c == '-') {
                minus = true;
                c = this.readByte();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res = res * 10 + c - '0';
                c = this.readByte();
            } while (!this.isSpaceChar(c));
            return minus ? -res : res;
        } if (!this.hasNext()) {
                throw new NoSuchElementException();
            } !this.hasNext() this.hasNext() this.hasNext this {
                throw new NoSuchElementException();
            } throw new NoSuchElementException(); new NoSuchElementException() int c = this.readByte(); c this.readByte() this.readByte this while (this.isSpaceChar(c)) {
                c = this.readByte();
            } this.isSpaceChar(c) this.isSpaceChar this c {
                c = this.readByte();
            } c = this.readByte() c this.readByte() this.readByte this boolean minus = false; minus false if (c == '-') {
                minus = true;
                c = this.readByte();
            } c == '-' c '-' {
                minus = true;
                c = this.readByte();
            } minus = true minus true c = this.readByte() c this.readByte() this.readByte this long res = 0; res 0 do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res = res * 10 + c - '0';
                c = this.readByte();
            } while (!this.isSpaceChar(c)); !this.isSpaceChar(c) this.isSpaceChar(c) this.isSpaceChar this c {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res = res * 10 + c - '0';
                c = this.readByte();
            } if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                } c < '0' || c > '9' c < '0' c '0' c > '9' c '9' {
                    throw new InputMismatchException();
                } throw new InputMismatchException(); new InputMismatchException() res = res * 10 + c - '0' res res * 10 + c - '0' res * 10 + c res * 10 res 10 c '0' c = this.readByte() c this.readByte() this.readByte this return minus ? -res : res; minus ? -res : res minus -res res res public double nextDouble() {
            return Double.parseDouble(this.next());
        } nextDouble {
            return Double.parseDouble(this.next());
        } return Double.parseDouble(this.next()); Double.parseDouble(this.next()) Double.parseDouble Double this.next() this.next this public int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = this.nextInt();
            }
            return a;
        } nextIntArray {
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = this.nextInt();
            }
            return a;
        } int[] a = new int[n]; a new int[n] n for (int i = 0; i < n; i++) {
                a[i] = this.nextInt();
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                a[i] = this.nextInt();
            } {
                a[i] = this.nextInt();
            } a[i] = this.nextInt() a[i] a i this.nextInt() this.nextInt this return a; a int n n public long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = this.nextLong();
            }
            return a;
        } nextLongArray {
            long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = this.nextLong();
            }
            return a;
        } long[] a = new long[n]; a new long[n] n for (int i = 0; i < n; i++) {
                a[i] = this.nextLong();
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                a[i] = this.nextLong();
            } {
                a[i] = this.nextLong();
            } a[i] = this.nextLong() a[i] a i this.nextLong() this.nextLong this return a; a int n n public char[][] nextCharMap(int n, int m) {
            char[][] map = new char[n][m];
            for (int i = 0; i < n; i++) {
                map[i] = this.next().toCharArray();
            }
            return map;
        } nextCharMap {
            char[][] map = new char[n][m];
            for (int i = 0; i < n; i++) {
                map[i] = this.next().toCharArray();
            }
            return map;
        } char[][] map = new char[n][m]; map new char[n][m] n m for (int i = 0; i < n; i++) {
                map[i] = this.next().toCharArray();
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                map[i] = this.next().toCharArray();
            } {
                map[i] = this.next().toCharArray();
            } map[i] = this.next().toCharArray() map[i] map i this.next().toCharArray() this.next().toCharArray this.next() this.next this return map; map int n n int m m
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.NoSuchElementException;
import java.util.StringJoiner;

class Main {

    static PrintWriter out;
    static InputReader sc;

    public static void main(String[] args) {
        sc = new InputReader(System.in);
        out = new PrintWriter(System.out);
        solve();
        out.flush();
    }

    static void solve() {
        int[][] c = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c[i][j] = sc.nextInt();
            }
        }
        int[] a = new int[3];
        int[] b = new int[3];
        for (int i = 0; i <= 100; i++) {
            for (int j = 0; j <= 100; j++) {
                Loop: for (int k = 0; k <= 100; k++) {
                    a[0] = i;
                    a[1] = j;
                    a[2] = k;
                    for (int l = 0; l < 3; l++) {
                        b[l] = c[0][l] - a[0];
                    }
                    for (int l = 1; l < 3; l++) {
                        for (int m = 0; m < 3; m++) {
                            if (c[l][m] != a[l] + b[m]) {
                                continue Loop;
                            }
                        }
                    }
                    out.println("Yes");
                    return;
                }
            }
        }
        out.println("No");
    }

    static void debug(Object... args) {
        StringJoiner j = new StringJoiner(" ");
        for (Object arg : args) {
            Class<?> type = arg.getClass();
            if (type.getComponentType().isArray()) {
                for (Object o : (Object[]) arg) {
                    debug(o);
                }
            } else if (arg instanceof int[]) {
                j.add(Arrays.toString((int[]) arg));
            } else if (arg instanceof long[]) {
                j.add(Arrays.toString((long[]) arg));
            } else if (arg instanceof double[]) {
                j.add(Arrays.toString((double[]) arg));
            } else if (arg instanceof char[]) {
                j.add(Arrays.toString((char[]) arg));
            } else if (arg instanceof boolean[]) {
                j.add(Arrays.toString((boolean[]) arg));
            } else if (arg instanceof Object[]) {
                j.add(Arrays.toString((Object[]) arg));
            } else {
                j.add(arg.toString());
            }
        }
        System.err.println(j.toString());
    }

    static class InputReader {

        private InputStream in;
        private byte[] buffer = new byte[1024];
        private int curbuf;
        private int lenbuf;

        public InputReader(InputStream in) {
            this.in = in;
            this.curbuf = this.lenbuf = 0;
        }

        public boolean hasNextByte() {
            if (this.curbuf >= this.lenbuf) {
                this.curbuf = 0;
                try {
                    this.lenbuf = this.in.read(this.buffer);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (this.lenbuf <= 0) {
                    return false;
                }
            }
            return true;
        }

        private int readByte() {
            if (this.hasNextByte()) {
                return this.buffer[this.curbuf++];
            } else {
                return -1;
            }
        }

        private boolean isSpaceChar(int c) {
            return !(c >= 33 && c <= 126);
        }

        private void skip() {
            while (this.hasNextByte() && this.isSpaceChar(this.buffer[this.curbuf])) {
                this.curbuf++;
            }
        }

        public boolean hasNext() {
            this.skip();
            return this.hasNextByte();
        }

        public String next() {
            if (!this.hasNext()) {
                throw new NoSuchElementException();
            }
            StringBuilder sb = new StringBuilder();
            int b = this.readByte();
            while (!this.isSpaceChar(b)) {
                sb.appendCodePoint(b);
                b = this.readByte();
            }
            return sb.toString();
        }

        public int nextInt() {
            if (!this.hasNext()) {
                throw new NoSuchElementException();
            }
            int c = this.readByte();
            while (this.isSpaceChar(c)) {
                c = this.readByte();
            }
            boolean minus = false;
            if (c == '-') {
                minus = true;
                c = this.readByte();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res = res * 10 + c - '0';
                c = this.readByte();
            } while (!this.isSpaceChar(c));
            return minus ? -res : res;
        }

        public long nextLong() {
            if (!this.hasNext()) {
                throw new NoSuchElementException();
            }
            int c = this.readByte();
            while (this.isSpaceChar(c)) {
                c = this.readByte();
            }
            boolean minus = false;
            if (c == '-') {
                minus = true;
                c = this.readByte();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res = res * 10 + c - '0';
                c = this.readByte();
            } while (!this.isSpaceChar(c));
            return minus ? -res : res;
        }

        public double nextDouble() {
            return Double.parseDouble(this.next());
        }

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

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

        public char[][] nextCharMap(int n, int m) {
            char[][] map = new char[n][m];
            for (int i = 0; i < n; i++) {
                map[i] = this.next().toCharArray();
            }
            return map;
        }
    }
}