
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int[][] b = new int[3][3];

		for (int x = 0; x < 3; x++) {
			String[] foo = br.readLine().split(" ");
			for (int y = 0; y < 3; y++) {
				b[x][y] = Integer.parseInt(foo[y]);
			}
		}

		int a2 = 0;
		int a3 = 0;
		int b1 = 0;
		int b2 = 0;
		int b3 = 0;

		for (int a1 = 0; a1 < 100; a1++) {
			b1 = b[0][0] - a1;
			b2 = b[0][1] - a1;
			b3 = b[0][2] - a1;

			int[] bls = { b1, b2, b3 };

			for (int x = 0; x < 3; x++) {
				if (x == 0) {
					a2 = b[1][x] - bls[x];
					a3 = b[2][x] - bls[x];
				} else {
					if (a2 != b[1][x] - bls[x]) {
						System.out.println("No");
						System.exit(0);
					}
					if (a3 != b[2][x] - bls[x]) {
						System.out.println("No");
						System.exit(0);
					}
					a2 = b[1][x] - bls[x];
					a3 = b[2][x] - bls[x];

				}
			}

		}
		System.out.println("Yes");

	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int[][] b = new int[3][3];

		for (int x = 0; x < 3; x++) {
			String[] foo = br.readLine().split(" ");
			for (int y = 0; y < 3; y++) {
				b[x][y] = Integer.parseInt(foo[y]);
			}
		}

		int a2 = 0;
		int a3 = 0;
		int b1 = 0;
		int b2 = 0;
		int b3 = 0;

		for (int a1 = 0; a1 < 100; a1++) {
			b1 = b[0][0] - a1;
			b2 = b[0][1] - a1;
			b3 = b[0][2] - a1;

			int[] bls = { b1, b2, b3 };

			for (int x = 0; x < 3; x++) {
				if (x == 0) {
					a2 = b[1][x] - bls[x];
					a3 = b[2][x] - bls[x];
				} else {
					if (a2 != b[1][x] - bls[x]) {
						System.out.println("No");
						System.exit(0);
					}
					if (a3 != b[2][x] - bls[x]) {
						System.out.println("No");
						System.exit(0);
					}
					a2 = b[1][x] - bls[x];
					a3 = b[2][x] - bls[x];

				}
			}

		}
		System.out.println("Yes");

	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int[][] b = new int[3][3];

		for (int x = 0; x < 3; x++) {
			String[] foo = br.readLine().split(" ");
			for (int y = 0; y < 3; y++) {
				b[x][y] = Integer.parseInt(foo[y]);
			}
		}

		int a2 = 0;
		int a3 = 0;
		int b1 = 0;
		int b2 = 0;
		int b3 = 0;

		for (int a1 = 0; a1 < 100; a1++) {
			b1 = b[0][0] - a1;
			b2 = b[0][1] - a1;
			b3 = b[0][2] - a1;

			int[] bls = { b1, b2, b3 };

			for (int x = 0; x < 3; x++) {
				if (x == 0) {
					a2 = b[1][x] - bls[x];
					a3 = b[2][x] - bls[x];
				} else {
					if (a2 != b[1][x] - bls[x]) {
						System.out.println("No");
						System.exit(0);
					}
					if (a3 != b[2][x] - bls[x]) {
						System.out.println("No");
						System.exit(0);
					}
					a2 = b[1][x] - bls[x];
					a3 = b[2][x] - bls[x];

				}
			}

		}
		System.out.println("Yes");

	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int[][] b = new int[3][3];

		for (int x = 0; x < 3; x++) {
			String[] foo = br.readLine().split(" ");
			for (int y = 0; y < 3; y++) {
				b[x][y] = Integer.parseInt(foo[y]);
			}
		}

		int a2 = 0;
		int a3 = 0;
		int b1 = 0;
		int b2 = 0;
		int b3 = 0;

		for (int a1 = 0; a1 < 100; a1++) {
			b1 = b[0][0] - a1;
			b2 = b[0][1] - a1;
			b3 = b[0][2] - a1;

			int[] bls = { b1, b2, b3 };

			for (int x = 0; x < 3; x++) {
				if (x == 0) {
					a2 = b[1][x] - bls[x];
					a3 = b[2][x] - bls[x];
				} else {
					if (a2 != b[1][x] - bls[x]) {
						System.out.println("No");
						System.exit(0);
					}
					if (a3 != b[2][x] - bls[x]) {
						System.out.println("No");
						System.exit(0);
					}
					a2 = b[1][x] - bls[x];
					a3 = b[2][x] - bls[x];

				}
			}

		}
		System.out.println("Yes");

	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int[][] b = new int[3][3]; b new int[3][3] 3 3 for (int x = 0; x < 3; x++) {
			String[] foo = br.readLine().split(" ");
			for (int y = 0; y < 3; y++) {
				b[x][y] = Integer.parseInt(foo[y]);
			}
		} int x = 0; int x = 0; x 0 x < 3 x 3 x++ x++ x {
			String[] foo = br.readLine().split(" ");
			for (int y = 0; y < 3; y++) {
				b[x][y] = Integer.parseInt(foo[y]);
			}
		} {
			String[] foo = br.readLine().split(" ");
			for (int y = 0; y < 3; y++) {
				b[x][y] = Integer.parseInt(foo[y]);
			}
		} String[] foo = br.readLine().split(" "); foo br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " for (int y = 0; y < 3; y++) {
				b[x][y] = Integer.parseInt(foo[y]);
			} int y = 0; int y = 0; y 0 y < 3 y 3 y++ y++ y {
				b[x][y] = Integer.parseInt(foo[y]);
			} {
				b[x][y] = Integer.parseInt(foo[y]);
			} b[x][y] = Integer.parseInt(foo[y]) b[x][y] b[x] b x y Integer.parseInt(foo[y]) Integer.parseInt Integer foo[y] foo y int a2 = 0; a2 0 int a3 = 0; a3 0 int b1 = 0; b1 0 int b2 = 0; b2 0 int b3 = 0; b3 0 for (int a1 = 0; a1 < 100; a1++) {
			b1 = b[0][0] - a1;
			b2 = b[0][1] - a1;
			b3 = b[0][2] - a1;

			int[] bls = { b1, b2, b3 };

			for (int x = 0; x < 3; x++) {
				if (x == 0) {
					a2 = b[1][x] - bls[x];
					a3 = b[2][x] - bls[x];
				} else {
					if (a2 != b[1][x] - bls[x]) {
						System.out.println("No");
						System.exit(0);
					}
					if (a3 != b[2][x] - bls[x]) {
						System.out.println("No");
						System.exit(0);
					}
					a2 = b[1][x] - bls[x];
					a3 = b[2][x] - bls[x];

				}
			}

		} int a1 = 0; int a1 = 0; a1 0 a1 < 100 a1 100 a1++ a1++ a1 {
			b1 = b[0][0] - a1;
			b2 = b[0][1] - a1;
			b3 = b[0][2] - a1;

			int[] bls = { b1, b2, b3 };

			for (int x = 0; x < 3; x++) {
				if (x == 0) {
					a2 = b[1][x] - bls[x];
					a3 = b[2][x] - bls[x];
				} else {
					if (a2 != b[1][x] - bls[x]) {
						System.out.println("No");
						System.exit(0);
					}
					if (a3 != b[2][x] - bls[x]) {
						System.out.println("No");
						System.exit(0);
					}
					a2 = b[1][x] - bls[x];
					a3 = b[2][x] - bls[x];

				}
			}

		} {
			b1 = b[0][0] - a1;
			b2 = b[0][1] - a1;
			b3 = b[0][2] - a1;

			int[] bls = { b1, b2, b3 };

			for (int x = 0; x < 3; x++) {
				if (x == 0) {
					a2 = b[1][x] - bls[x];
					a3 = b[2][x] - bls[x];
				} else {
					if (a2 != b[1][x] - bls[x]) {
						System.out.println("No");
						System.exit(0);
					}
					if (a3 != b[2][x] - bls[x]) {
						System.out.println("No");
						System.exit(0);
					}
					a2 = b[1][x] - bls[x];
					a3 = b[2][x] - bls[x];

				}
			}

		} b1 = b[0][0] - a1 b1 b[0][0] - a1 b[0][0] b[0] b 0 0 a1 b2 = b[0][1] - a1 b2 b[0][1] - a1 b[0][1] b[0] b 0 1 a1 b3 = b[0][2] - a1 b3 b[0][2] - a1 b[0][2] b[0] b 0 2 a1 int[] bls = { b1, b2, b3 }; bls { b1, b2, b3 } b1 b2 b3 for (int x = 0; x < 3; x++) {
				if (x == 0) {
					a2 = b[1][x] - bls[x];
					a3 = b[2][x] - bls[x];
				} else {
					if (a2 != b[1][x] - bls[x]) {
						System.out.println("No");
						System.exit(0);
					}
					if (a3 != b[2][x] - bls[x]) {
						System.out.println("No");
						System.exit(0);
					}
					a2 = b[1][x] - bls[x];
					a3 = b[2][x] - bls[x];

				}
			} int x = 0; int x = 0; x 0 x < 3 x 3 x++ x++ x {
				if (x == 0) {
					a2 = b[1][x] - bls[x];
					a3 = b[2][x] - bls[x];
				} else {
					if (a2 != b[1][x] - bls[x]) {
						System.out.println("No");
						System.exit(0);
					}
					if (a3 != b[2][x] - bls[x]) {
						System.out.println("No");
						System.exit(0);
					}
					a2 = b[1][x] - bls[x];
					a3 = b[2][x] - bls[x];

				}
			} {
				if (x == 0) {
					a2 = b[1][x] - bls[x];
					a3 = b[2][x] - bls[x];
				} else {
					if (a2 != b[1][x] - bls[x]) {
						System.out.println("No");
						System.exit(0);
					}
					if (a3 != b[2][x] - bls[x]) {
						System.out.println("No");
						System.exit(0);
					}
					a2 = b[1][x] - bls[x];
					a3 = b[2][x] - bls[x];

				}
			} if (x == 0) {
					a2 = b[1][x] - bls[x];
					a3 = b[2][x] - bls[x];
				} else {
					if (a2 != b[1][x] - bls[x]) {
						System.out.println("No");
						System.exit(0);
					}
					if (a3 != b[2][x] - bls[x]) {
						System.out.println("No");
						System.exit(0);
					}
					a2 = b[1][x] - bls[x];
					a3 = b[2][x] - bls[x];

				} x == 0 x 0 {
					a2 = b[1][x] - bls[x];
					a3 = b[2][x] - bls[x];
				} a2 = b[1][x] - bls[x] a2 b[1][x] - bls[x] b[1][x] b[1] b 1 x bls[x] bls x a3 = b[2][x] - bls[x] a3 b[2][x] - bls[x] b[2][x] b[2] b 2 x bls[x] bls x {
					if (a2 != b[1][x] - bls[x]) {
						System.out.println("No");
						System.exit(0);
					}
					if (a3 != b[2][x] - bls[x]) {
						System.out.println("No");
						System.exit(0);
					}
					a2 = b[1][x] - bls[x];
					a3 = b[2][x] - bls[x];

				} if (a2 != b[1][x] - bls[x]) {
						System.out.println("No");
						System.exit(0);
					} a2 != b[1][x] - bls[x] a2 b[1][x] - bls[x] b[1][x] b[1] b 1 x bls[x] bls x {
						System.out.println("No");
						System.exit(0);
					} System.out.println("No") System.out.println System.out System System.out "No" System.exit(0) System.exit System 0 if (a3 != b[2][x] - bls[x]) {
						System.out.println("No");
						System.exit(0);
					} a3 != b[2][x] - bls[x] a3 b[2][x] - bls[x] b[2][x] b[2] b 2 x bls[x] bls x {
						System.out.println("No");
						System.exit(0);
					} System.out.println("No") System.out.println System.out System System.out "No" System.exit(0) System.exit System 0 a2 = b[1][x] - bls[x] a2 b[1][x] - bls[x] b[1][x] b[1] b 1 x bls[x] bls x a3 = b[2][x] - bls[x] a3 b[2][x] - bls[x] b[2][x] b[2] b 2 x bls[x] bls x System.out.println("Yes") System.out.println System.out System System.out "Yes" String[] args args public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int[][] b = new int[3][3];

		for (int x = 0; x < 3; x++) {
			String[] foo = br.readLine().split(" ");
			for (int y = 0; y < 3; y++) {
				b[x][y] = Integer.parseInt(foo[y]);
			}
		}

		int a2 = 0;
		int a3 = 0;
		int b1 = 0;
		int b2 = 0;
		int b3 = 0;

		for (int a1 = 0; a1 < 100; a1++) {
			b1 = b[0][0] - a1;
			b2 = b[0][1] - a1;
			b3 = b[0][2] - a1;

			int[] bls = { b1, b2, b3 };

			for (int x = 0; x < 3; x++) {
				if (x == 0) {
					a2 = b[1][x] - bls[x];
					a3 = b[2][x] - bls[x];
				} else {
					if (a2 != b[1][x] - bls[x]) {
						System.out.println("No");
						System.exit(0);
					}
					if (a3 != b[2][x] - bls[x]) {
						System.out.println("No");
						System.exit(0);
					}
					a2 = b[1][x] - bls[x];
					a3 = b[2][x] - bls[x];

				}
			}

		}
		System.out.println("Yes");

	}
} public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int[][] b = new int[3][3];

		for (int x = 0; x < 3; x++) {
			String[] foo = br.readLine().split(" ");
			for (int y = 0; y < 3; y++) {
				b[x][y] = Integer.parseInt(foo[y]);
			}
		}

		int a2 = 0;
		int a3 = 0;
		int b1 = 0;
		int b2 = 0;
		int b3 = 0;

		for (int a1 = 0; a1 < 100; a1++) {
			b1 = b[0][0] - a1;
			b2 = b[0][1] - a1;
			b3 = b[0][2] - a1;

			int[] bls = { b1, b2, b3 };

			for (int x = 0; x < 3; x++) {
				if (x == 0) {
					a2 = b[1][x] - bls[x];
					a3 = b[2][x] - bls[x];
				} else {
					if (a2 != b[1][x] - bls[x]) {
						System.out.println("No");
						System.exit(0);
					}
					if (a3 != b[2][x] - bls[x]) {
						System.out.println("No");
						System.exit(0);
					}
					a2 = b[1][x] - bls[x];
					a3 = b[2][x] - bls[x];

				}
			}

		}
		System.out.println("Yes");

	}
} Main

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int[][] b = new int[3][3];

		for (int x = 0; x < 3; x++) {
			String[] foo = br.readLine().split(" ");
			for (int y = 0; y < 3; y++) {
				b[x][y] = Integer.parseInt(foo[y]);
			}
		}

		int a2 = 0;
		int a3 = 0;
		int b1 = 0;
		int b2 = 0;
		int b3 = 0;

		for (int a1 = 0; a1 < 100; a1++) {
			b1 = b[0][0] - a1;
			b2 = b[0][1] - a1;
			b3 = b[0][2] - a1;

			int[] bls = { b1, b2, b3 };

			for (int x = 0; x < 3; x++) {
				if (x == 0) {
					a2 = b[1][x] - bls[x];
					a3 = b[2][x] - bls[x];
				} else {
					if (a2 != b[1][x] - bls[x]) {
						System.out.println("No");
						System.exit(0);
					}
					if (a3 != b[2][x] - bls[x]) {
						System.out.println("No");
						System.exit(0);
					}
					a2 = b[1][x] - bls[x];
					a3 = b[2][x] - bls[x];

				}
			}

		}
		System.out.println("Yes");

	}
}
