import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[][] c = new int[3][3];
		int[] a = new int[3];
		int[] b = new int[3];

		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				c[i][j] = sc.nextInt();
			}
		}

		// Initialize a & b
		for (int i = 0; i < 3; i++) {
			int max = 0;
			for (int j = 0; j < 3; j++) {
				max = Math.max(c[i][j], max);
			}
			a[i] = max;
		}
		for (int j = 0; j < 3; j++) {
			int max = 0;
			for (int i = 0; i < 3; i++) {
				max = Math.max(c[i][j], max);
			}
			b[j] = max;
		}

		while (true) {
			if (check(a, b, c)) {
				System.out.println("Yes");
				return;
			}

			for (int i = 0; i < 3; i++) {
				boolean[] bigger = new boolean[3];
				for (int j = 0; j < 3; j++) {
					bigger[j] = (a[i] + b[j] > c[i][j]);
				}
				if (bigger[0] == bigger[1] && bigger[1] == bigger[2]) {
					if (bigger[0]) {
						a[i]--;
					}
				}
			}
			for (int j = 0; j < 3; j++) {
				boolean[] bigger = new boolean[3];
				for (int i = 0; i < 3; i++) {
					bigger[i] = (a[i] + b[j] > c[i][j]);
				}
				if (bigger[0] == bigger[1] && bigger[1] == bigger[2]) {
					if (bigger[0]) {
						b[j]--;
					}
				} else {
					System.out.println("No");
					return;
				}
			}
		}
	}

	private static boolean check(int[] a, int[] b, int[][] c) {
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (c[i][j] != a[i] + b[j]) {
					return false;
				}
			}
		}
		return true;
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[][] c = new int[3][3];
		int[] a = new int[3];
		int[] b = new int[3];

		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				c[i][j] = sc.nextInt();
			}
		}

		// Initialize a & b
		for (int i = 0; i < 3; i++) {
			int max = 0;
			for (int j = 0; j < 3; j++) {
				max = Math.max(c[i][j], max);
			}
			a[i] = max;
		}
		for (int j = 0; j < 3; j++) {
			int max = 0;
			for (int i = 0; i < 3; i++) {
				max = Math.max(c[i][j], max);
			}
			b[j] = max;
		}

		while (true) {
			if (check(a, b, c)) {
				System.out.println("Yes");
				return;
			}

			for (int i = 0; i < 3; i++) {
				boolean[] bigger = new boolean[3];
				for (int j = 0; j < 3; j++) {
					bigger[j] = (a[i] + b[j] > c[i][j]);
				}
				if (bigger[0] == bigger[1] && bigger[1] == bigger[2]) {
					if (bigger[0]) {
						a[i]--;
					}
				}
			}
			for (int j = 0; j < 3; j++) {
				boolean[] bigger = new boolean[3];
				for (int i = 0; i < 3; i++) {
					bigger[i] = (a[i] + b[j] > c[i][j]);
				}
				if (bigger[0] == bigger[1] && bigger[1] == bigger[2]) {
					if (bigger[0]) {
						b[j]--;
					}
				} else {
					System.out.println("No");
					return;
				}
			}
		}
	}

	private static boolean check(int[] a, int[] b, int[][] c) {
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (c[i][j] != a[i] + b[j]) {
					return false;
				}
			}
		}
		return true;
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[][] c = new int[3][3];
		int[] a = new int[3];
		int[] b = new int[3];

		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				c[i][j] = sc.nextInt();
			}
		}

		// Initialize a & b
		for (int i = 0; i < 3; i++) {
			int max = 0;
			for (int j = 0; j < 3; j++) {
				max = Math.max(c[i][j], max);
			}
			a[i] = max;
		}
		for (int j = 0; j < 3; j++) {
			int max = 0;
			for (int i = 0; i < 3; i++) {
				max = Math.max(c[i][j], max);
			}
			b[j] = max;
		}

		while (true) {
			if (check(a, b, c)) {
				System.out.println("Yes");
				return;
			}

			for (int i = 0; i < 3; i++) {
				boolean[] bigger = new boolean[3];
				for (int j = 0; j < 3; j++) {
					bigger[j] = (a[i] + b[j] > c[i][j]);
				}
				if (bigger[0] == bigger[1] && bigger[1] == bigger[2]) {
					if (bigger[0]) {
						a[i]--;
					}
				}
			}
			for (int j = 0; j < 3; j++) {
				boolean[] bigger = new boolean[3];
				for (int i = 0; i < 3; i++) {
					bigger[i] = (a[i] + b[j] > c[i][j]);
				}
				if (bigger[0] == bigger[1] && bigger[1] == bigger[2]) {
					if (bigger[0]) {
						b[j]--;
					}
				} else {
					System.out.println("No");
					return;
				}
			}
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int[][] c = new int[3][3];
		int[] a = new int[3];
		int[] b = new int[3];

		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				c[i][j] = sc.nextInt();
			}
		}

		// Initialize a & b
		for (int i = 0; i < 3; i++) {
			int max = 0;
			for (int j = 0; j < 3; j++) {
				max = Math.max(c[i][j], max);
			}
			a[i] = max;
		}
		for (int j = 0; j < 3; j++) {
			int max = 0;
			for (int i = 0; i < 3; i++) {
				max = Math.max(c[i][j], max);
			}
			b[j] = max;
		}

		while (true) {
			if (check(a, b, c)) {
				System.out.println("Yes");
				return;
			}

			for (int i = 0; i < 3; i++) {
				boolean[] bigger = new boolean[3];
				for (int j = 0; j < 3; j++) {
					bigger[j] = (a[i] + b[j] > c[i][j]);
				}
				if (bigger[0] == bigger[1] && bigger[1] == bigger[2]) {
					if (bigger[0]) {
						a[i]--;
					}
				}
			}
			for (int j = 0; j < 3; j++) {
				boolean[] bigger = new boolean[3];
				for (int i = 0; i < 3; i++) {
					bigger[i] = (a[i] + b[j] > c[i][j]);
				}
				if (bigger[0] == bigger[1] && bigger[1] == bigger[2]) {
					if (bigger[0]) {
						b[j]--;
					}
				} else {
					System.out.println("No");
					return;
				}
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[][] c = new int[3][3]; c new int[3][3] 3 3 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++) {
			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 for (int i = 0; i < 3; i++) {
			int max = 0;
			for (int j = 0; j < 3; j++) {
				max = Math.max(c[i][j], max);
			}
			a[i] = max;
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			int max = 0;
			for (int j = 0; j < 3; j++) {
				max = Math.max(c[i][j], max);
			}
			a[i] = max;
		} {
			int max = 0;
			for (int j = 0; j < 3; j++) {
				max = Math.max(c[i][j], max);
			}
			a[i] = max;
		} int max = 0; max 0 for (int j = 0; j < 3; j++) {
				max = Math.max(c[i][j], max);
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				max = Math.max(c[i][j], max);
			} {
				max = Math.max(c[i][j], max);
			} max = Math.max(c[i][j], max) max Math.max(c[i][j], max) Math.max Math c[i][j] c[i] c i j max a[i] = max a[i] a i max for (int j = 0; j < 3; j++) {
			int max = 0;
			for (int i = 0; i < 3; i++) {
				max = Math.max(c[i][j], max);
			}
			b[j] = max;
		} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
			int max = 0;
			for (int i = 0; i < 3; i++) {
				max = Math.max(c[i][j], max);
			}
			b[j] = max;
		} {
			int max = 0;
			for (int i = 0; i < 3; i++) {
				max = Math.max(c[i][j], max);
			}
			b[j] = max;
		} int max = 0; max 0 for (int i = 0; i < 3; i++) {
				max = Math.max(c[i][j], max);
			} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
				max = Math.max(c[i][j], max);
			} {
				max = Math.max(c[i][j], max);
			} max = Math.max(c[i][j], max) max Math.max(c[i][j], max) Math.max Math c[i][j] c[i] c i j max b[j] = max b[j] b j max while (true) {
			if (check(a, b, c)) {
				System.out.println("Yes");
				return;
			}

			for (int i = 0; i < 3; i++) {
				boolean[] bigger = new boolean[3];
				for (int j = 0; j < 3; j++) {
					bigger[j] = (a[i] + b[j] > c[i][j]);
				}
				if (bigger[0] == bigger[1] && bigger[1] == bigger[2]) {
					if (bigger[0]) {
						a[i]--;
					}
				}
			}
			for (int j = 0; j < 3; j++) {
				boolean[] bigger = new boolean[3];
				for (int i = 0; i < 3; i++) {
					bigger[i] = (a[i] + b[j] > c[i][j]);
				}
				if (bigger[0] == bigger[1] && bigger[1] == bigger[2]) {
					if (bigger[0]) {
						b[j]--;
					}
				} else {
					System.out.println("No");
					return;
				}
			}
		} true {
			if (check(a, b, c)) {
				System.out.println("Yes");
				return;
			}

			for (int i = 0; i < 3; i++) {
				boolean[] bigger = new boolean[3];
				for (int j = 0; j < 3; j++) {
					bigger[j] = (a[i] + b[j] > c[i][j]);
				}
				if (bigger[0] == bigger[1] && bigger[1] == bigger[2]) {
					if (bigger[0]) {
						a[i]--;
					}
				}
			}
			for (int j = 0; j < 3; j++) {
				boolean[] bigger = new boolean[3];
				for (int i = 0; i < 3; i++) {
					bigger[i] = (a[i] + b[j] > c[i][j]);
				}
				if (bigger[0] == bigger[1] && bigger[1] == bigger[2]) {
					if (bigger[0]) {
						b[j]--;
					}
				} else {
					System.out.println("No");
					return;
				}
			}
		} if (check(a, b, c)) {
				System.out.println("Yes");
				return;
			} check(a, b, c) check a b c {
				System.out.println("Yes");
				return;
			} System.out.println("Yes") System.out.println System.out System System.out "Yes" return; for (int i = 0; i < 3; i++) {
				boolean[] bigger = new boolean[3];
				for (int j = 0; j < 3; j++) {
					bigger[j] = (a[i] + b[j] > c[i][j]);
				}
				if (bigger[0] == bigger[1] && bigger[1] == bigger[2]) {
					if (bigger[0]) {
						a[i]--;
					}
				}
			} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
				boolean[] bigger = new boolean[3];
				for (int j = 0; j < 3; j++) {
					bigger[j] = (a[i] + b[j] > c[i][j]);
				}
				if (bigger[0] == bigger[1] && bigger[1] == bigger[2]) {
					if (bigger[0]) {
						a[i]--;
					}
				}
			} {
				boolean[] bigger = new boolean[3];
				for (int j = 0; j < 3; j++) {
					bigger[j] = (a[i] + b[j] > c[i][j]);
				}
				if (bigger[0] == bigger[1] && bigger[1] == bigger[2]) {
					if (bigger[0]) {
						a[i]--;
					}
				}
			} boolean[] bigger = new boolean[3]; bigger new boolean[3] 3 for (int j = 0; j < 3; j++) {
					bigger[j] = (a[i] + b[j] > c[i][j]);
				} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
					bigger[j] = (a[i] + b[j] > c[i][j]);
				} {
					bigger[j] = (a[i] + b[j] > c[i][j]);
				} bigger[j] = (a[i] + b[j] > c[i][j]) bigger[j] bigger j (a[i] + b[j] > c[i][j]) a[i] + b[j] a[i] a i b[j] b j c[i][j] c[i] c i j if (bigger[0] == bigger[1] && bigger[1] == bigger[2]) {
					if (bigger[0]) {
						a[i]--;
					}
				} bigger[0] == bigger[1] && bigger[1] == bigger[2] bigger[0] == bigger[1] bigger[0] bigger 0 bigger[1] bigger 1 bigger[1] == bigger[2] bigger[1] bigger 1 bigger[2] bigger 2 {
					if (bigger[0]) {
						a[i]--;
					}
				} if (bigger[0]) {
						a[i]--;
					} bigger[0] bigger 0 {
						a[i]--;
					} a[i]-- a[i] a i for (int j = 0; j < 3; j++) {
				boolean[] bigger = new boolean[3];
				for (int i = 0; i < 3; i++) {
					bigger[i] = (a[i] + b[j] > c[i][j]);
				}
				if (bigger[0] == bigger[1] && bigger[1] == bigger[2]) {
					if (bigger[0]) {
						b[j]--;
					}
				} else {
					System.out.println("No");
					return;
				}
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				boolean[] bigger = new boolean[3];
				for (int i = 0; i < 3; i++) {
					bigger[i] = (a[i] + b[j] > c[i][j]);
				}
				if (bigger[0] == bigger[1] && bigger[1] == bigger[2]) {
					if (bigger[0]) {
						b[j]--;
					}
				} else {
					System.out.println("No");
					return;
				}
			} {
				boolean[] bigger = new boolean[3];
				for (int i = 0; i < 3; i++) {
					bigger[i] = (a[i] + b[j] > c[i][j]);
				}
				if (bigger[0] == bigger[1] && bigger[1] == bigger[2]) {
					if (bigger[0]) {
						b[j]--;
					}
				} else {
					System.out.println("No");
					return;
				}
			} boolean[] bigger = new boolean[3]; bigger new boolean[3] 3 for (int i = 0; i < 3; i++) {
					bigger[i] = (a[i] + b[j] > c[i][j]);
				} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
					bigger[i] = (a[i] + b[j] > c[i][j]);
				} {
					bigger[i] = (a[i] + b[j] > c[i][j]);
				} bigger[i] = (a[i] + b[j] > c[i][j]) bigger[i] bigger i (a[i] + b[j] > c[i][j]) a[i] + b[j] a[i] a i b[j] b j c[i][j] c[i] c i j if (bigger[0] == bigger[1] && bigger[1] == bigger[2]) {
					if (bigger[0]) {
						b[j]--;
					}
				} else {
					System.out.println("No");
					return;
				} bigger[0] == bigger[1] && bigger[1] == bigger[2] bigger[0] == bigger[1] bigger[0] bigger 0 bigger[1] bigger 1 bigger[1] == bigger[2] bigger[1] bigger 1 bigger[2] bigger 2 {
					if (bigger[0]) {
						b[j]--;
					}
				} if (bigger[0]) {
						b[j]--;
					} bigger[0] bigger 0 {
						b[j]--;
					} b[j]-- b[j] b j {
					System.out.println("No");
					return;
				} System.out.println("No") System.out.println System.out System System.out "No" return; String[] args args private static boolean check(int[] a, int[] b, int[][] c) {
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (c[i][j] != a[i] + b[j]) {
					return false;
				}
			}
		}
		return true;
	} check {
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (c[i][j] != a[i] + b[j]) {
					return false;
				}
			}
		}
		return true;
	} for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (c[i][j] != a[i] + b[j]) {
					return false;
				}
			}
		} 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]) {
					return false;
				}
			}
		} {
			for (int j = 0; j < 3; j++) {
				if (c[i][j] != a[i] + b[j]) {
					return false;
				}
			}
		} for (int j = 0; j < 3; j++) {
				if (c[i][j] != a[i] + b[j]) {
					return false;
				}
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				if (c[i][j] != a[i] + b[j]) {
					return false;
				}
			} {
				if (c[i][j] != a[i] + b[j]) {
					return false;
				}
			} if (c[i][j] != a[i] + b[j]) {
					return false;
				} 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 {
					return false;
				} return false; false return true; true int[] a a int[] b b int[][] c c public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[][] c = new int[3][3];
		int[] a = new int[3];
		int[] b = new int[3];

		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				c[i][j] = sc.nextInt();
			}
		}

		// Initialize a & b
		for (int i = 0; i < 3; i++) {
			int max = 0;
			for (int j = 0; j < 3; j++) {
				max = Math.max(c[i][j], max);
			}
			a[i] = max;
		}
		for (int j = 0; j < 3; j++) {
			int max = 0;
			for (int i = 0; i < 3; i++) {
				max = Math.max(c[i][j], max);
			}
			b[j] = max;
		}

		while (true) {
			if (check(a, b, c)) {
				System.out.println("Yes");
				return;
			}

			for (int i = 0; i < 3; i++) {
				boolean[] bigger = new boolean[3];
				for (int j = 0; j < 3; j++) {
					bigger[j] = (a[i] + b[j] > c[i][j]);
				}
				if (bigger[0] == bigger[1] && bigger[1] == bigger[2]) {
					if (bigger[0]) {
						a[i]--;
					}
				}
			}
			for (int j = 0; j < 3; j++) {
				boolean[] bigger = new boolean[3];
				for (int i = 0; i < 3; i++) {
					bigger[i] = (a[i] + b[j] > c[i][j]);
				}
				if (bigger[0] == bigger[1] && bigger[1] == bigger[2]) {
					if (bigger[0]) {
						b[j]--;
					}
				} else {
					System.out.println("No");
					return;
				}
			}
		}
	}

	private static boolean check(int[] a, int[] b, int[][] c) {
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (c[i][j] != a[i] + b[j]) {
					return false;
				}
			}
		}
		return true;
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[][] c = new int[3][3];
		int[] a = new int[3];
		int[] b = new int[3];

		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				c[i][j] = sc.nextInt();
			}
		}

		// Initialize a & b
		for (int i = 0; i < 3; i++) {
			int max = 0;
			for (int j = 0; j < 3; j++) {
				max = Math.max(c[i][j], max);
			}
			a[i] = max;
		}
		for (int j = 0; j < 3; j++) {
			int max = 0;
			for (int i = 0; i < 3; i++) {
				max = Math.max(c[i][j], max);
			}
			b[j] = max;
		}

		while (true) {
			if (check(a, b, c)) {
				System.out.println("Yes");
				return;
			}

			for (int i = 0; i < 3; i++) {
				boolean[] bigger = new boolean[3];
				for (int j = 0; j < 3; j++) {
					bigger[j] = (a[i] + b[j] > c[i][j]);
				}
				if (bigger[0] == bigger[1] && bigger[1] == bigger[2]) {
					if (bigger[0]) {
						a[i]--;
					}
				}
			}
			for (int j = 0; j < 3; j++) {
				boolean[] bigger = new boolean[3];
				for (int i = 0; i < 3; i++) {
					bigger[i] = (a[i] + b[j] > c[i][j]);
				}
				if (bigger[0] == bigger[1] && bigger[1] == bigger[2]) {
					if (bigger[0]) {
						b[j]--;
					}
				} else {
					System.out.println("No");
					return;
				}
			}
		}
	}

	private static boolean check(int[] a, int[] b, int[][] c) {
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (c[i][j] != a[i] + b[j]) {
					return false;
				}
			}
		}
		return true;
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[][] c = new int[3][3];
		int[] a = new int[3];
		int[] b = new int[3];

		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				c[i][j] = sc.nextInt();
			}
		}

		// Initialize a & b
		for (int i = 0; i < 3; i++) {
			int max = 0;
			for (int j = 0; j < 3; j++) {
				max = Math.max(c[i][j], max);
			}
			a[i] = max;
		}
		for (int j = 0; j < 3; j++) {
			int max = 0;
			for (int i = 0; i < 3; i++) {
				max = Math.max(c[i][j], max);
			}
			b[j] = max;
		}

		while (true) {
			if (check(a, b, c)) {
				System.out.println("Yes");
				return;
			}

			for (int i = 0; i < 3; i++) {
				boolean[] bigger = new boolean[3];
				for (int j = 0; j < 3; j++) {
					bigger[j] = (a[i] + b[j] > c[i][j]);
				}
				if (bigger[0] == bigger[1] && bigger[1] == bigger[2]) {
					if (bigger[0]) {
						a[i]--;
					}
				}
			}
			for (int j = 0; j < 3; j++) {
				boolean[] bigger = new boolean[3];
				for (int i = 0; i < 3; i++) {
					bigger[i] = (a[i] + b[j] > c[i][j]);
				}
				if (bigger[0] == bigger[1] && bigger[1] == bigger[2]) {
					if (bigger[0]) {
						b[j]--;
					}
				} else {
					System.out.println("No");
					return;
				}
			}
		}
	}

	private static boolean check(int[] a, int[] b, int[][] c) {
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (c[i][j] != a[i] + b[j]) {
					return false;
				}
			}
		}
		return true;
	}
}
