import java.util.Scanner;

final class Solver {
	static final Solver INSTANCE = new Solver();

	void solve(Scanner sc) {
		int[][] grid = new int[3][3];
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				grid[i][j] = sc.nextInt();
			}
		}
		int[] a = new int[3];
		int[] b = new int[3];
		for (int i = 0; i < 3; i++) {
			a[i] = grid[0][(i + 2) % 3] - grid[0][(i + 1) % 3];
			b[i] = grid[(i + 2) % 3][0] - grid[(i + 1) % 3][0];
		}
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (a[i] != grid[j][(i + 2) % 3] - grid[j][(i + 1) % 3]
				|| b[i] != grid[(i + 2) % 3][j] - grid[(i + 1) % 3][j]) {
					System.out.println("No");
					return;
				}
			}
		}
		System.out.println("Yes");
	}
}

class Main {
	public static void main(String... args) {
		Scanner in = new Scanner(System.in);

		Solver.INSTANCE.solve(in);

		in.close();
	}
} import java.util.Scanner; Scanner java.util final class Solver {
	static final Solver INSTANCE = new Solver();

	void solve(Scanner sc) {
		int[][] grid = new int[3][3];
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				grid[i][j] = sc.nextInt();
			}
		}
		int[] a = new int[3];
		int[] b = new int[3];
		for (int i = 0; i < 3; i++) {
			a[i] = grid[0][(i + 2) % 3] - grid[0][(i + 1) % 3];
			b[i] = grid[(i + 2) % 3][0] - grid[(i + 1) % 3][0];
		}
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (a[i] != grid[j][(i + 2) % 3] - grid[j][(i + 1) % 3]
				|| b[i] != grid[(i + 2) % 3][j] - grid[(i + 1) % 3][j]) {
					System.out.println("No");
					return;
				}
			}
		}
		System.out.println("Yes");
	}
} Solver static final Solver INSTANCE = new Solver(); INSTANCE new Solver() void solve(Scanner sc) {
		int[][] grid = new int[3][3];
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				grid[i][j] = sc.nextInt();
			}
		}
		int[] a = new int[3];
		int[] b = new int[3];
		for (int i = 0; i < 3; i++) {
			a[i] = grid[0][(i + 2) % 3] - grid[0][(i + 1) % 3];
			b[i] = grid[(i + 2) % 3][0] - grid[(i + 1) % 3][0];
		}
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (a[i] != grid[j][(i + 2) % 3] - grid[j][(i + 1) % 3]
				|| b[i] != grid[(i + 2) % 3][j] - grid[(i + 1) % 3][j]) {
					System.out.println("No");
					return;
				}
			}
		}
		System.out.println("Yes");
	} solve {
		int[][] grid = new int[3][3];
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				grid[i][j] = sc.nextInt();
			}
		}
		int[] a = new int[3];
		int[] b = new int[3];
		for (int i = 0; i < 3; i++) {
			a[i] = grid[0][(i + 2) % 3] - grid[0][(i + 1) % 3];
			b[i] = grid[(i + 2) % 3][0] - grid[(i + 1) % 3][0];
		}
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (a[i] != grid[j][(i + 2) % 3] - grid[j][(i + 1) % 3]
				|| b[i] != grid[(i + 2) % 3][j] - grid[(i + 1) % 3][j]) {
					System.out.println("No");
					return;
				}
			}
		}
		System.out.println("Yes");
	} int[][] grid = new int[3][3]; grid new int[3][3] 3 3 for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				grid[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++) {
				grid[i][j] = sc.nextInt();
			}
		} {
			for (int j = 0; j < 3; j++) {
				grid[i][j] = sc.nextInt();
			}
		} for (int j = 0; j < 3; j++) {
				grid[i][j] = sc.nextInt();
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				grid[i][j] = sc.nextInt();
			} {
				grid[i][j] = sc.nextInt();
			} grid[i][j] = sc.nextInt() grid[i][j] grid[i] grid 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 < 3; i++) {
			a[i] = grid[0][(i + 2) % 3] - grid[0][(i + 1) % 3];
			b[i] = grid[(i + 2) % 3][0] - grid[(i + 1) % 3][0];
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			a[i] = grid[0][(i + 2) % 3] - grid[0][(i + 1) % 3];
			b[i] = grid[(i + 2) % 3][0] - grid[(i + 1) % 3][0];
		} {
			a[i] = grid[0][(i + 2) % 3] - grid[0][(i + 1) % 3];
			b[i] = grid[(i + 2) % 3][0] - grid[(i + 1) % 3][0];
		} a[i] = grid[0][(i + 2) % 3] - grid[0][(i + 1) % 3] a[i] a i grid[0][(i + 2) % 3] - grid[0][(i + 1) % 3] grid[0][(i + 2) % 3] grid[0] grid 0 (i + 2) % 3 (i + 2) i 2 3 grid[0][(i + 1) % 3] grid[0] grid 0 (i + 1) % 3 (i + 1) i 1 3 b[i] = grid[(i + 2) % 3][0] - grid[(i + 1) % 3][0] b[i] b i grid[(i + 2) % 3][0] - grid[(i + 1) % 3][0] grid[(i + 2) % 3][0] grid[(i + 2) % 3] grid (i + 2) % 3 (i + 2) i 2 3 0 grid[(i + 1) % 3][0] grid[(i + 1) % 3] grid (i + 1) % 3 (i + 1) i 1 3 0 for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (a[i] != grid[j][(i + 2) % 3] - grid[j][(i + 1) % 3]
				|| b[i] != grid[(i + 2) % 3][j] - grid[(i + 1) % 3][j]) {
					System.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 (a[i] != grid[j][(i + 2) % 3] - grid[j][(i + 1) % 3]
				|| b[i] != grid[(i + 2) % 3][j] - grid[(i + 1) % 3][j]) {
					System.out.println("No");
					return;
				}
			}
		} {
			for (int j = 0; j < 3; j++) {
				if (a[i] != grid[j][(i + 2) % 3] - grid[j][(i + 1) % 3]
				|| b[i] != grid[(i + 2) % 3][j] - grid[(i + 1) % 3][j]) {
					System.out.println("No");
					return;
				}
			}
		} for (int j = 0; j < 3; j++) {
				if (a[i] != grid[j][(i + 2) % 3] - grid[j][(i + 1) % 3]
				|| b[i] != grid[(i + 2) % 3][j] - grid[(i + 1) % 3][j]) {
					System.out.println("No");
					return;
				}
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				if (a[i] != grid[j][(i + 2) % 3] - grid[j][(i + 1) % 3]
				|| b[i] != grid[(i + 2) % 3][j] - grid[(i + 1) % 3][j]) {
					System.out.println("No");
					return;
				}
			} {
				if (a[i] != grid[j][(i + 2) % 3] - grid[j][(i + 1) % 3]
				|| b[i] != grid[(i + 2) % 3][j] - grid[(i + 1) % 3][j]) {
					System.out.println("No");
					return;
				}
			} if (a[i] != grid[j][(i + 2) % 3] - grid[j][(i + 1) % 3]
				|| b[i] != grid[(i + 2) % 3][j] - grid[(i + 1) % 3][j]) {
					System.out.println("No");
					return;
				} a[i] != grid[j][(i + 2) % 3] - grid[j][(i + 1) % 3]
				|| b[i] != grid[(i + 2) % 3][j] - grid[(i + 1) % 3][j] a[i] != grid[j][(i + 2) % 3] - grid[j][(i + 1) % 3] a[i] a i grid[j][(i + 2) % 3] - grid[j][(i + 1) % 3] grid[j][(i + 2) % 3] grid[j] grid j (i + 2) % 3 (i + 2) i 2 3 grid[j][(i + 1) % 3] grid[j] grid j (i + 1) % 3 (i + 1) i 1 3 b[i] != grid[(i + 2) % 3][j] - grid[(i + 1) % 3][j] b[i] b i grid[(i + 2) % 3][j] - grid[(i + 1) % 3][j] grid[(i + 2) % 3][j] grid[(i + 2) % 3] grid (i + 2) % 3 (i + 2) i 2 3 j grid[(i + 1) % 3][j] grid[(i + 1) % 3] grid (i + 1) % 3 (i + 1) i 1 3 j {
					System.out.println("No");
					return;
				} System.out.println("No") System.out.println System.out System System.out "No" return; System.out.println("Yes") System.out.println System.out System System.out "Yes" Scanner sc sc class Main {
	public static void main(String... args) {
		Scanner in = new Scanner(System.in);

		Solver.INSTANCE.solve(in);

		in.close();
	}
} Main public static void main(String... args) {
		Scanner in = new Scanner(System.in);

		Solver.INSTANCE.solve(in);

		in.close();
	} main {
		Scanner in = new Scanner(System.in);

		Solver.INSTANCE.solve(in);

		in.close();
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) Solver.INSTANCE.solve(in) Solver.INSTANCE.solve Solver.INSTANCE Solver Solver.INSTANCE in in.close() in.close in String... args args
import java.util.Scanner;

final class Solver {
	static final Solver INSTANCE = new Solver();

	void solve(Scanner sc) {
		int[][] grid = new int[3][3];
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				grid[i][j] = sc.nextInt();
			}
		}
		int[] a = new int[3];
		int[] b = new int[3];
		for (int i = 0; i < 3; i++) {
			a[i] = grid[0][(i + 2) % 3] - grid[0][(i + 1) % 3];
			b[i] = grid[(i + 2) % 3][0] - grid[(i + 1) % 3][0];
		}
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (a[i] != grid[j][(i + 2) % 3] - grid[j][(i + 1) % 3]
				|| b[i] != grid[(i + 2) % 3][j] - grid[(i + 1) % 3][j]) {
					System.out.println("No");
					return;
				}
			}
		}
		System.out.println("Yes");
	}
}

class Main {
	public static void main(String... args) {
		Scanner in = new Scanner(System.in);

		Solver.INSTANCE.solve(in);

		in.close();
	}
}