import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
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.i();
                                }
                        }
                        int a0 = 0;
                        int b0 = c[0][0];
                        int b1 = c[0][1];
                        int b2 = c[0][2];
                        int a1 = c[1][0] - b0;
                        int a2 = c[2][0] - b0;
                        int[] a = {a0, a1, a2};
                        int[] b = {b0, b1, b2};
                        for (int i = 0; i < 3; i++) {
                                for (int j = 0; j < 3; j++) {
                                        if (c[i][j] != a[i] + b[j]) {
                                                out.println("No");
                                                return;
                                        }
                                }
                        }
                        out.println("Yes");
                }

        }

        static class InputReader {
                InputStream is;
                private byte[] inbuf = new byte[1024];
                public int lenbuf = 0;
                public int ptrbuf = 0;

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

                private int readByte() {
                        if (lenbuf == -1) throw new InputMismatchException();
                        if (ptrbuf >= lenbuf) {
                                ptrbuf = 0;
                                try {
                                        lenbuf = is.read(inbuf);
                                } catch (IOException e) {
                                        throw new InputMismatchException();
                                }
                                if (lenbuf <= 0) return -1;
                        }
                        return inbuf[ptrbuf++];
                }

                public int i() {
                        int num = 0, b;
                        boolean minus = false;
                        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
                        if (b == '-') {
                                minus = true;
                                b = readByte();
                        }

                        while (true) {
                                if (b >= '0' && b <= '9') {
                                        num = num * 10 + (b - '0');
                                } else {
                                        return minus ? -num : num;
                                }
                                b = readByte();
                        }
                }

        }
}
 import java.io.OutputStream; OutputStream java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.InputMismatchException; InputMismatchException java.util 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.i();
                                }
                        }
                        int a0 = 0;
                        int b0 = c[0][0];
                        int b1 = c[0][1];
                        int b2 = c[0][2];
                        int a1 = c[1][0] - b0;
                        int a2 = c[2][0] - b0;
                        int[] a = {a0, a1, a2};
                        int[] b = {b0, b1, b2};
                        for (int i = 0; i < 3; i++) {
                                for (int j = 0; j < 3; j++) {
                                        if (c[i][j] != a[i] + b[j]) {
                                                out.println("No");
                                                return;
                                        }
                                }
                        }
                        out.println("Yes");
                }

        }

        static class InputReader {
                InputStream is;
                private byte[] inbuf = new byte[1024];
                public int lenbuf = 0;
                public int ptrbuf = 0;

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

                private int readByte() {
                        if (lenbuf == -1) throw new InputMismatchException();
                        if (ptrbuf >= lenbuf) {
                                ptrbuf = 0;
                                try {
                                        lenbuf = is.read(inbuf);
                                } catch (IOException e) {
                                        throw new InputMismatchException();
                                }
                                if (lenbuf <= 0) return -1;
                        }
                        return inbuf[ptrbuf++];
                }

                public int i() {
                        int num = 0, b;
                        boolean minus = false;
                        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
                        if (b == '-') {
                                minus = true;
                                b = readByte();
                        }

                        while (true) {
                                if (b >= '0' && b <= '9') {
                                        num = num * 10 + (b - '0');
                                } else {
                                        return minus ? -num : num;
                                }
                                b = readByte();
                        }
                }

        }
} 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.i();
                                }
                        }
                        int a0 = 0;
                        int b0 = c[0][0];
                        int b1 = c[0][1];
                        int b2 = c[0][2];
                        int a1 = c[1][0] - b0;
                        int a2 = c[2][0] - b0;
                        int[] a = {a0, a1, a2};
                        int[] b = {b0, b1, b2};
                        for (int i = 0; i < 3; i++) {
                                for (int j = 0; j < 3; j++) {
                                        if (c[i][j] != a[i] + b[j]) {
                                                out.println("No");
                                                return;
                                        }
                                }
                        }
                        out.println("Yes");
                }

        } TaskC public void solve(int testNumber, InputReader in, PrintWriter out) {
                        int[][] c = new int[3][3];
                        for (int i = 0; i < 3; i++) {
                                for (int j = 0; j < 3; j++) {
                                        c[i][j] = in.i();
                                }
                        }
                        int a0 = 0;
                        int b0 = c[0][0];
                        int b1 = c[0][1];
                        int b2 = c[0][2];
                        int a1 = c[1][0] - b0;
                        int a2 = c[2][0] - b0;
                        int[] a = {a0, a1, a2};
                        int[] b = {b0, b1, b2};
                        for (int i = 0; i < 3; i++) {
                                for (int j = 0; j < 3; j++) {
                                        if (c[i][j] != a[i] + b[j]) {
                                                out.println("No");
                                                return;
                                        }
                                }
                        }
                        out.println("Yes");
                } 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.i();
                                }
                        }
                        int a0 = 0;
                        int b0 = c[0][0];
                        int b1 = c[0][1];
                        int b2 = c[0][2];
                        int a1 = c[1][0] - b0;
                        int a2 = c[2][0] - b0;
                        int[] a = {a0, a1, a2};
                        int[] b = {b0, b1, b2};
                        for (int i = 0; i < 3; i++) {
                                for (int j = 0; j < 3; j++) {
                                        if (c[i][j] != a[i] + b[j]) {
                                                out.println("No");
                                                return;
                                        }
                                }
                        }
                        out.println("Yes");
                } int[][] c = new int[3][3]; c new int[3][3] 3 3 for (int i = 0; i < 3; i++) {
                                for (int j = 0; j < 3; j++) {
                                        c[i][j] = in.i();
                                }
                        } 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.i();
                                }
                        } {
                                for (int j = 0; j < 3; j++) {
                                        c[i][j] = in.i();
                                }
                        } for (int j = 0; j < 3; j++) {
                                        c[i][j] = in.i();
                                } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
                                        c[i][j] = in.i();
                                } {
                                        c[i][j] = in.i();
                                } c[i][j] = in.i() c[i][j] c[i] c i j in.i() in.i in int a0 = 0; a0 0 int b0 = c[0][0]; b0 c[0][0] c[0] c 0 0 int b1 = c[0][1]; b1 c[0][1] c[0] c 0 1 int b2 = c[0][2]; b2 c[0][2] c[0] c 0 2 int a1 = c[1][0] - b0; a1 c[1][0] - b0 c[1][0] c[1] c 1 0 b0 int a2 = c[2][0] - b0; a2 c[2][0] - b0 c[2][0] c[2] c 2 0 b0 int[] a = {a0, a1, a2}; a {a0, a1, a2} a0 a1 a2 int[] b = {b0, b1, b2}; b {b0, b1, b2} b0 b1 b2 for (int i = 0; i < 3; i++) {
                                for (int j = 0; j < 3; j++) {
                                        if (c[i][j] != a[i] + b[j]) {
                                                out.println("No");
                                                return;
                                        }
                                }
                        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
                                for (int j = 0; j < 3; j++) {
                                        if (c[i][j] != a[i] + b[j]) {
                                                out.println("No");
                                                return;
                                        }
                                }
                        } {
                                for (int j = 0; j < 3; j++) {
                                        if (c[i][j] != a[i] + b[j]) {
                                                out.println("No");
                                                return;
                                        }
                                }
                        } for (int j = 0; j < 3; j++) {
                                        if (c[i][j] != a[i] + b[j]) {
                                                out.println("No");
                                                return;
                                        }
                                } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
                                        if (c[i][j] != a[i] + b[j]) {
                                                out.println("No");
                                                return;
                                        }
                                } {
                                        if (c[i][j] != a[i] + b[j]) {
                                                out.println("No");
                                                return;
                                        }
                                } if (c[i][j] != a[i] + b[j]) {
                                                out.println("No");
                                                return;
                                        } c[i][j] != a[i] + b[j] c[i][j] c[i] c i j a[i] + b[j] a[i] a i b[j] b j {
                                                out.println("No");
                                                return;
                                        } out.println("No") out.println out "No" return; out.println("Yes") out.println out "Yes" int testNumber testNumber InputReader in in PrintWriter out out static class InputReader {
                InputStream is;
                private byte[] inbuf = new byte[1024];
                public int lenbuf = 0;
                public int ptrbuf = 0;

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

                private int readByte() {
                        if (lenbuf == -1) throw new InputMismatchException();
                        if (ptrbuf >= lenbuf) {
                                ptrbuf = 0;
                                try {
                                        lenbuf = is.read(inbuf);
                                } catch (IOException e) {
                                        throw new InputMismatchException();
                                }
                                if (lenbuf <= 0) return -1;
                        }
                        return inbuf[ptrbuf++];
                }

                public int i() {
                        int num = 0, b;
                        boolean minus = false;
                        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
                        if (b == '-') {
                                minus = true;
                                b = readByte();
                        }

                        while (true) {
                                if (b >= '0' && b <= '9') {
                                        num = num * 10 + (b - '0');
                                } else {
                                        return minus ? -num : num;
                                }
                                b = readByte();
                        }
                }

        } InputReader InputStream is; is private byte[] inbuf = new byte[1024]; inbuf new byte[1024] 1024 public int lenbuf = 0; lenbuf 0 public int ptrbuf = 0; ptrbuf 0 public InputReader(InputStream is) {
                        this.is = is;
                } InputReader {
                        this.is = is;
                } this.is = is this.is this this.is is InputStream is is private int readByte() {
                        if (lenbuf == -1) throw new InputMismatchException();
                        if (ptrbuf >= lenbuf) {
                                ptrbuf = 0;
                                try {
                                        lenbuf = is.read(inbuf);
                                } catch (IOException e) {
                                        throw new InputMismatchException();
                                }
                                if (lenbuf <= 0) return -1;
                        }
                        return inbuf[ptrbuf++];
                } readByte {
                        if (lenbuf == -1) throw new InputMismatchException();
                        if (ptrbuf >= lenbuf) {
                                ptrbuf = 0;
                                try {
                                        lenbuf = is.read(inbuf);
                                } catch (IOException e) {
                                        throw new InputMismatchException();
                                }
                                if (lenbuf <= 0) return -1;
                        }
                        return inbuf[ptrbuf++];
                } if (lenbuf == -1) throw new InputMismatchException(); lenbuf == -1 lenbuf -1 1 throw new InputMismatchException(); new InputMismatchException() if (ptrbuf >= lenbuf) {
                                ptrbuf = 0;
                                try {
                                        lenbuf = is.read(inbuf);
                                } catch (IOException e) {
                                        throw new InputMismatchException();
                                }
                                if (lenbuf <= 0) return -1;
                        } ptrbuf >= lenbuf ptrbuf lenbuf {
                                ptrbuf = 0;
                                try {
                                        lenbuf = is.read(inbuf);
                                } catch (IOException e) {
                                        throw new InputMismatchException();
                                }
                                if (lenbuf <= 0) return -1;
                        } ptrbuf = 0 ptrbuf 0 try {
                                        lenbuf = is.read(inbuf);
                                } catch (IOException e) {
                                        throw new InputMismatchException();
                                } catch (IOException e) {
                                        throw new InputMismatchException();
                                } IOException e {
                                        throw new InputMismatchException();
                                } throw new InputMismatchException(); new InputMismatchException() {
                                        lenbuf = is.read(inbuf);
                                } lenbuf = is.read(inbuf) lenbuf is.read(inbuf) is.read is inbuf if (lenbuf <= 0) return -1; lenbuf <= 0 lenbuf 0 return -1; -1 1 return inbuf[ptrbuf++]; inbuf[ptrbuf++] inbuf ptrbuf++ ptrbuf public int i() {
                        int num = 0, b;
                        boolean minus = false;
                        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
                        if (b == '-') {
                                minus = true;
                                b = readByte();
                        }

                        while (true) {
                                if (b >= '0' && b <= '9') {
                                        num = num * 10 + (b - '0');
                                } else {
                                        return minus ? -num : num;
                                }
                                b = readByte();
                        }
                } i {
                        int num = 0, b;
                        boolean minus = false;
                        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
                        if (b == '-') {
                                minus = true;
                                b = readByte();
                        }

                        while (true) {
                                if (b >= '0' && b <= '9') {
                                        num = num * 10 + (b - '0');
                                } else {
                                        return minus ? -num : num;
                                }
                                b = readByte();
                        }
                } int num = 0 num 0 b; b boolean minus = false; minus false while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ; (b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-') (b = readByte()) != -1 (b = readByte()) b readByte() readByte -1 1 !((b >= '0' && b <= '9') || b == '-') ((b >= '0' && b <= '9') || b == '-') (b >= '0' && b <= '9') b >= '0' b '0' b <= '9' b '9' b == '-' b '-' if (b == '-') {
                                minus = true;
                                b = readByte();
                        } b == '-' b '-' {
                                minus = true;
                                b = readByte();
                        } minus = true minus true b = readByte() b readByte() readByte while (true) {
                                if (b >= '0' && b <= '9') {
                                        num = num * 10 + (b - '0');
                                } else {
                                        return minus ? -num : num;
                                }
                                b = readByte();
                        } true {
                                if (b >= '0' && b <= '9') {
                                        num = num * 10 + (b - '0');
                                } else {
                                        return minus ? -num : num;
                                }
                                b = readByte();
                        } if (b >= '0' && b <= '9') {
                                        num = num * 10 + (b - '0');
                                } else {
                                        return minus ? -num : num;
                                } b >= '0' && b <= '9' b >= '0' b '0' b <= '9' b '9' {
                                        num = num * 10 + (b - '0');
                                } num = num * 10 + (b - '0') num num * 10 + (b - '0') num * 10 num 10 (b - '0') b '0' {
                                        return minus ? -num : num;
                                } return minus ? -num : num; minus ? -num : num minus -num num num b = readByte() b readByte() readByte 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.i();
                                }
                        }
                        int a0 = 0;
                        int b0 = c[0][0];
                        int b1 = c[0][1];
                        int b2 = c[0][2];
                        int a1 = c[1][0] - b0;
                        int a2 = c[2][0] - b0;
                        int[] a = {a0, a1, a2};
                        int[] b = {b0, b1, b2};
                        for (int i = 0; i < 3; i++) {
                                for (int j = 0; j < 3; j++) {
                                        if (c[i][j] != a[i] + b[j]) {
                                                out.println("No");
                                                return;
                                        }
                                }
                        }
                        out.println("Yes");
                }

        }

        static class InputReader {
                InputStream is;
                private byte[] inbuf = new byte[1024];
                public int lenbuf = 0;
                public int ptrbuf = 0;

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

                private int readByte() {
                        if (lenbuf == -1) throw new InputMismatchException();
                        if (ptrbuf >= lenbuf) {
                                ptrbuf = 0;
                                try {
                                        lenbuf = is.read(inbuf);
                                } catch (IOException e) {
                                        throw new InputMismatchException();
                                }
                                if (lenbuf <= 0) return -1;
                        }
                        return inbuf[ptrbuf++];
                }

                public int i() {
                        int num = 0, b;
                        boolean minus = false;
                        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
                        if (b == '-') {
                                minus = true;
                                b = readByte();
                        }

                        while (true) {
                                if (b >= '0' && b <= '9') {
                                        num = num * 10 + (b - '0');
                                } else {
                                        return minus ? -num : num;
                                }
                                b = readByte();
                        }
                }

        }
} 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.i();
                                }
                        }
                        int a0 = 0;
                        int b0 = c[0][0];
                        int b1 = c[0][1];
                        int b2 = c[0][2];
                        int a1 = c[1][0] - b0;
                        int a2 = c[2][0] - b0;
                        int[] a = {a0, a1, a2};
                        int[] b = {b0, b1, b2};
                        for (int i = 0; i < 3; i++) {
                                for (int j = 0; j < 3; j++) {
                                        if (c[i][j] != a[i] + b[j]) {
                                                out.println("No");
                                                return;
                                        }
                                }
                        }
                        out.println("Yes");
                }

        }

        static class InputReader {
                InputStream is;
                private byte[] inbuf = new byte[1024];
                public int lenbuf = 0;
                public int ptrbuf = 0;

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

                private int readByte() {
                        if (lenbuf == -1) throw new InputMismatchException();
                        if (ptrbuf >= lenbuf) {
                                ptrbuf = 0;
                                try {
                                        lenbuf = is.read(inbuf);
                                } catch (IOException e) {
                                        throw new InputMismatchException();
                                }
                                if (lenbuf <= 0) return -1;
                        }
                        return inbuf[ptrbuf++];
                }

                public int i() {
                        int num = 0, b;
                        boolean minus = false;
                        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
                        if (b == '-') {
                                minus = true;
                                b = readByte();
                        }

                        while (true) {
                                if (b >= '0' && b <= '9') {
                                        num = num * 10 + (b - '0');
                                } else {
                                        return minus ? -num : num;
                                }
                                b = readByte();
                        }
                }

        }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
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.i();
                                }
                        }
                        int a0 = 0;
                        int b0 = c[0][0];
                        int b1 = c[0][1];
                        int b2 = c[0][2];
                        int a1 = c[1][0] - b0;
                        int a2 = c[2][0] - b0;
                        int[] a = {a0, a1, a2};
                        int[] b = {b0, b1, b2};
                        for (int i = 0; i < 3; i++) {
                                for (int j = 0; j < 3; j++) {
                                        if (c[i][j] != a[i] + b[j]) {
                                                out.println("No");
                                                return;
                                        }
                                }
                        }
                        out.println("Yes");
                }

        }

        static class InputReader {
                InputStream is;
                private byte[] inbuf = new byte[1024];
                public int lenbuf = 0;
                public int ptrbuf = 0;

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

                private int readByte() {
                        if (lenbuf == -1) throw new InputMismatchException();
                        if (ptrbuf >= lenbuf) {
                                ptrbuf = 0;
                                try {
                                        lenbuf = is.read(inbuf);
                                } catch (IOException e) {
                                        throw new InputMismatchException();
                                }
                                if (lenbuf <= 0) return -1;
                        }
                        return inbuf[ptrbuf++];
                }

                public int i() {
                        int num = 0, b;
                        boolean minus = false;
                        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
                        if (b == '-') {
                                minus = true;
                                b = readByte();
                        }

                        while (true) {
                                if (b >= '0' && b <= '9') {
                                        num = num * 10 + (b - '0');
                                } else {
                                        return minus ? -num : num;
                                }
                                b = readByte();
                        }
                }

        }
}

