import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int[][] c = new int[3][3];
		boolean b = true;

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

		for (int i = 0; i < 2; i++) {
			for (int j = 0; j < 2; j++) {
				if (b) {
					b = c[i][j] - c[i][j + 1] == c[i + 1][j] - c[i + 1][j + 1];
				}
			}

		}

		String str = b ? "Yes" : "No";
		System.out.println(str);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int[][] c = new int[3][3];
		boolean b = true;

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

		for (int i = 0; i < 2; i++) {
			for (int j = 0; j < 2; j++) {
				if (b) {
					b = c[i][j] - c[i][j + 1] == c[i + 1][j] - c[i + 1][j + 1];
				}
			}

		}

		String str = b ? "Yes" : "No";
		System.out.println(str);
	}
} Main public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int[][] c = new int[3][3];
		boolean b = true;

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

		for (int i = 0; i < 2; i++) {
			for (int j = 0; j < 2; j++) {
				if (b) {
					b = c[i][j] - c[i][j + 1] == c[i + 1][j] - c[i + 1][j + 1];
				}
			}

		}

		String str = b ? "Yes" : "No";
		System.out.println(str);
	} main {
		Scanner s = new Scanner(System.in);
		int[][] c = new int[3][3];
		boolean b = true;

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

		for (int i = 0; i < 2; i++) {
			for (int j = 0; j < 2; j++) {
				if (b) {
					b = c[i][j] - c[i][j + 1] == c[i + 1][j] - c[i + 1][j + 1];
				}
			}

		}

		String str = b ? "Yes" : "No";
		System.out.println(str);
	} Scanner s = new Scanner(System.in); s new Scanner(System.in) int[][] c = new int[3][3]; c new int[3][3] 3 3 boolean b = true; b true for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				c[i][j] = s.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] = s.nextInt();
			}
		} {
			for (int j = 0; j < 3; j++) {
				c[i][j] = s.nextInt();
			}
		} for (int j = 0; j < 3; j++) {
				c[i][j] = s.nextInt();
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				c[i][j] = s.nextInt();
			} {
				c[i][j] = s.nextInt();
			} c[i][j] = s.nextInt() c[i][j] c[i] c i j s.nextInt() s.nextInt s for (int i = 0; i < 2; i++) {
			for (int j = 0; j < 2; j++) {
				if (b) {
					b = c[i][j] - c[i][j + 1] == c[i + 1][j] - c[i + 1][j + 1];
				}
			}

		} int i = 0; int i = 0; i 0 i < 2 i 2 i++ i++ i {
			for (int j = 0; j < 2; j++) {
				if (b) {
					b = c[i][j] - c[i][j + 1] == c[i + 1][j] - c[i + 1][j + 1];
				}
			}

		} {
			for (int j = 0; j < 2; j++) {
				if (b) {
					b = c[i][j] - c[i][j + 1] == c[i + 1][j] - c[i + 1][j + 1];
				}
			}

		} for (int j = 0; j < 2; j++) {
				if (b) {
					b = c[i][j] - c[i][j + 1] == c[i + 1][j] - c[i + 1][j + 1];
				}
			} int j = 0; int j = 0; j 0 j < 2 j 2 j++ j++ j {
				if (b) {
					b = c[i][j] - c[i][j + 1] == c[i + 1][j] - c[i + 1][j + 1];
				}
			} {
				if (b) {
					b = c[i][j] - c[i][j + 1] == c[i + 1][j] - c[i + 1][j + 1];
				}
			} if (b) {
					b = c[i][j] - c[i][j + 1] == c[i + 1][j] - c[i + 1][j + 1];
				} b {
					b = c[i][j] - c[i][j + 1] == c[i + 1][j] - c[i + 1][j + 1];
				} b = c[i][j] - c[i][j + 1] == c[i + 1][j] - c[i + 1][j + 1] b c[i][j] - c[i][j + 1] == c[i + 1][j] - c[i + 1][j + 1] c[i][j] - c[i][j + 1] c[i][j] c[i] c i j c[i][j + 1] c[i] c i j + 1 j 1 c[i + 1][j] - c[i + 1][j + 1] c[i + 1][j] c[i + 1] c i + 1 i 1 j c[i + 1][j + 1] c[i + 1] c i + 1 i 1 j + 1 j 1 String str = b ? "Yes" : "No"; str b ? "Yes" : "No" b "Yes" "No" System.out.println(str) System.out.println System.out System System.out str String[] args args public class Main {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int[][] c = new int[3][3];
		boolean b = true;

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

		for (int i = 0; i < 2; i++) {
			for (int j = 0; j < 2; j++) {
				if (b) {
					b = c[i][j] - c[i][j + 1] == c[i + 1][j] - c[i + 1][j + 1];
				}
			}

		}

		String str = b ? "Yes" : "No";
		System.out.println(str);
	}
} public class Main {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int[][] c = new int[3][3];
		boolean b = true;

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

		for (int i = 0; i < 2; i++) {
			for (int j = 0; j < 2; j++) {
				if (b) {
					b = c[i][j] - c[i][j + 1] == c[i + 1][j] - c[i + 1][j + 1];
				}
			}

		}

		String str = b ? "Yes" : "No";
		System.out.println(str);
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int[][] c = new int[3][3];
		boolean b = true;

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

		for (int i = 0; i < 2; i++) {
			for (int j = 0; j < 2; j++) {
				if (b) {
					b = c[i][j] - c[i][j + 1] == c[i + 1][j] - c[i + 1][j + 1];
				}
			}

		}

		String str = b ? "Yes" : "No";
		System.out.println(str);
	}
}
