import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int[][] map = new int[3][3];
			for (int i = 0; i < 3; i++) {
				for (int j = 0; j< 3; j++) {
					map[i][j] = scanner.nextInt();
				}
			}

			int temp2 = map[0][1] - map[0][0];
			int temp3 = map[0][2] - map[0][0];

			if (map[1][1] - map[1][0] == temp2 && map[2][1] - map[2][0] == temp2 && map[1][2] - map[1][0] == temp3 && map[2][2] - map[2][0] == temp3) {
				System.out.println("Yes");
			} else {
				System.out.println("No");
			}
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int[][] map = new int[3][3];
			for (int i = 0; i < 3; i++) {
				for (int j = 0; j< 3; j++) {
					map[i][j] = scanner.nextInt();
				}
			}

			int temp2 = map[0][1] - map[0][0];
			int temp3 = map[0][2] - map[0][0];

			if (map[1][1] - map[1][0] == temp2 && map[2][1] - map[2][0] == temp2 && map[1][2] - map[1][0] == temp3 && map[2][2] - map[2][0] == temp3) {
				System.out.println("Yes");
			} else {
				System.out.println("No");
			}
		}
	}
} Main public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int[][] map = new int[3][3];
			for (int i = 0; i < 3; i++) {
				for (int j = 0; j< 3; j++) {
					map[i][j] = scanner.nextInt();
				}
			}

			int temp2 = map[0][1] - map[0][0];
			int temp3 = map[0][2] - map[0][0];

			if (map[1][1] - map[1][0] == temp2 && map[2][1] - map[2][0] == temp2 && map[1][2] - map[1][0] == temp3 && map[2][2] - map[2][0] == temp3) {
				System.out.println("Yes");
			} else {
				System.out.println("No");
			}
		}
	} main {
		try (Scanner scanner = new Scanner(System.in)) {
			int[][] map = new int[3][3];
			for (int i = 0; i < 3; i++) {
				for (int j = 0; j< 3; j++) {
					map[i][j] = scanner.nextInt();
				}
			}

			int temp2 = map[0][1] - map[0][0];
			int temp3 = map[0][2] - map[0][0];

			if (map[1][1] - map[1][0] == temp2 && map[2][1] - map[2][0] == temp2 && map[1][2] - map[1][0] == temp3 && map[2][2] - map[2][0] == temp3) {
				System.out.println("Yes");
			} else {
				System.out.println("No");
			}
		}
	} try (Scanner scanner = new Scanner(System.in)) {
			int[][] map = new int[3][3];
			for (int i = 0; i < 3; i++) {
				for (int j = 0; j< 3; j++) {
					map[i][j] = scanner.nextInt();
				}
			}

			int temp2 = map[0][1] - map[0][0];
			int temp3 = map[0][2] - map[0][0];

			if (map[1][1] - map[1][0] == temp2 && map[2][1] - map[2][0] == temp2 && map[1][2] - map[1][0] == temp3 && map[2][2] - map[2][0] == temp3) {
				System.out.println("Yes");
			} else {
				System.out.println("No");
			}
		} {
			int[][] map = new int[3][3];
			for (int i = 0; i < 3; i++) {
				for (int j = 0; j< 3; j++) {
					map[i][j] = scanner.nextInt();
				}
			}

			int temp2 = map[0][1] - map[0][0];
			int temp3 = map[0][2] - map[0][0];

			if (map[1][1] - map[1][0] == temp2 && map[2][1] - map[2][0] == temp2 && map[1][2] - map[1][0] == temp3 && map[2][2] - map[2][0] == temp3) {
				System.out.println("Yes");
			} else {
				System.out.println("No");
			}
		} Scanner scanner = new Scanner(System.in) Scanner scanner = new Scanner(System.in) new Scanner(System.in) int[][] map = new int[3][3]; map new int[3][3] 3 3 for (int i = 0; i < 3; i++) {
				for (int j = 0; j< 3; j++) {
					map[i][j] = scanner.nextInt();
				}
			} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
				for (int j = 0; j< 3; j++) {
					map[i][j] = scanner.nextInt();
				}
			} {
				for (int j = 0; j< 3; j++) {
					map[i][j] = scanner.nextInt();
				}
			} for (int j = 0; j< 3; j++) {
					map[i][j] = scanner.nextInt();
				} int j = 0; int j = 0; j 0 j< 3 j 3 j++ j++ j {
					map[i][j] = scanner.nextInt();
				} {
					map[i][j] = scanner.nextInt();
				} map[i][j] = scanner.nextInt() map[i][j] map[i] map i j scanner.nextInt() scanner.nextInt scanner int temp2 = map[0][1] - map[0][0]; temp2 map[0][1] - map[0][0] map[0][1] map[0] map 0 1 map[0][0] map[0] map 0 0 int temp3 = map[0][2] - map[0][0]; temp3 map[0][2] - map[0][0] map[0][2] map[0] map 0 2 map[0][0] map[0] map 0 0 if (map[1][1] - map[1][0] == temp2 && map[2][1] - map[2][0] == temp2 && map[1][2] - map[1][0] == temp3 && map[2][2] - map[2][0] == temp3) {
				System.out.println("Yes");
			} else {
				System.out.println("No");
			} map[1][1] - map[1][0] == temp2 && map[2][1] - map[2][0] == temp2 && map[1][2] - map[1][0] == temp3 && map[2][2] - map[2][0] == temp3 map[1][2] - map[1][0] == temp3 map[1][1] - map[1][0] == temp2 && map[2][1] - map[2][0] == temp2 && map[1][2] - map[1][0] == temp3 && map[2][2] - map[2][0] == temp3 map[1][1] - map[1][0] == temp2 map[1][1] - map[1][0] map[1][1] map[1] map 1 1 map[1][0] map[1] map 1 0 temp2 map[2][1] - map[2][0] == temp2 map[2][1] - map[2][0] map[2][1] map[2] map 2 1 map[2][0] map[2] map 2 0 temp2 map[1][2] - map[1][0] == temp3 map[1][2] - map[1][0] map[1][2] map[1] map 1 2 map[1][0] map[1] map 1 0 temp3 map[2][2] - map[2][0] == temp3 map[2][2] - map[2][0] map[2][2] map[2] map 2 2 map[2][0] map[2] map 2 0 temp3 {
				System.out.println("Yes");
			} System.out.println("Yes") System.out.println System.out System System.out "Yes" {
				System.out.println("No");
			} System.out.println("No") System.out.println System.out System System.out "No" String[] args args public class Main {
	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int[][] map = new int[3][3];
			for (int i = 0; i < 3; i++) {
				for (int j = 0; j< 3; j++) {
					map[i][j] = scanner.nextInt();
				}
			}

			int temp2 = map[0][1] - map[0][0];
			int temp3 = map[0][2] - map[0][0];

			if (map[1][1] - map[1][0] == temp2 && map[2][1] - map[2][0] == temp2 && map[1][2] - map[1][0] == temp3 && map[2][2] - map[2][0] == temp3) {
				System.out.println("Yes");
			} else {
				System.out.println("No");
			}
		}
	}
} public class Main {
	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int[][] map = new int[3][3];
			for (int i = 0; i < 3; i++) {
				for (int j = 0; j< 3; j++) {
					map[i][j] = scanner.nextInt();
				}
			}

			int temp2 = map[0][1] - map[0][0];
			int temp3 = map[0][2] - map[0][0];

			if (map[1][1] - map[1][0] == temp2 && map[2][1] - map[2][0] == temp2 && map[1][2] - map[1][0] == temp3 && map[2][2] - map[2][0] == temp3) {
				System.out.println("Yes");
			} else {
				System.out.println("No");
			}
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int[][] map = new int[3][3];
			for (int i = 0; i < 3; i++) {
				for (int j = 0; j< 3; j++) {
					map[i][j] = scanner.nextInt();
				}
			}

			int temp2 = map[0][1] - map[0][0];
			int temp3 = map[0][2] - map[0][0];

			if (map[1][1] - map[1][0] == temp2 && map[2][1] - map[2][0] == temp2 && map[1][2] - map[1][0] == temp3 && map[2][2] - map[2][0] == temp3) {
				System.out.println("Yes");
			} else {
				System.out.println("No");
			}
		}
	}
}
