import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		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] = sc.nextInt();
			}
		}
		loop: for (int i = 0; i < 2; i++) {
			for (int j = i + 1; j < 3; j++) {
				if (c[i][0] - c[j][0] == c[i][1] - c[j][1] && c[i][1] - c[j][1] == c[i][2] - c[j][2]) {

				} else {
					b = false;
					break loop;
				}
			}
		}

		loop: for (int i = 0; i < 2; i++) {
			for (int j = i + 1; j < 3; j++) {
				if (c[0][i] - c[0][j] == c[1][i] - c[1][j] && c[1][i] - c[1][j] == c[2][i] - c[2][j]) {

				} else {
					b = false;
					break loop;
				}
			}
		}

		if (b) {
			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) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		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] = sc.nextInt();
			}
		}
		loop: for (int i = 0; i < 2; i++) {
			for (int j = i + 1; j < 3; j++) {
				if (c[i][0] - c[j][0] == c[i][1] - c[j][1] && c[i][1] - c[j][1] == c[i][2] - c[j][2]) {

				} else {
					b = false;
					break loop;
				}
			}
		}

		loop: for (int i = 0; i < 2; i++) {
			for (int j = i + 1; j < 3; j++) {
				if (c[0][i] - c[0][j] == c[1][i] - c[1][j] && c[1][i] - c[1][j] == c[2][i] - c[2][j]) {

				} else {
					b = false;
					break loop;
				}
			}
		}

		if (b) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		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] = sc.nextInt();
			}
		}
		loop: for (int i = 0; i < 2; i++) {
			for (int j = i + 1; j < 3; j++) {
				if (c[i][0] - c[j][0] == c[i][1] - c[j][1] && c[i][1] - c[j][1] == c[i][2] - c[j][2]) {

				} else {
					b = false;
					break loop;
				}
			}
		}

		loop: for (int i = 0; i < 2; i++) {
			for (int j = i + 1; j < 3; j++) {
				if (c[0][i] - c[0][j] == c[1][i] - c[1][j] && c[1][i] - c[1][j] == c[2][i] - c[2][j]) {

				} else {
					b = false;
					break loop;
				}
			}
		}

		if (b) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

	} main {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		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] = sc.nextInt();
			}
		}
		loop: for (int i = 0; i < 2; i++) {
			for (int j = i + 1; j < 3; j++) {
				if (c[i][0] - c[j][0] == c[i][1] - c[j][1] && c[i][1] - c[j][1] == c[i][2] - c[j][2]) {

				} else {
					b = false;
					break loop;
				}
			}
		}

		loop: for (int i = 0; i < 2; i++) {
			for (int j = i + 1; j < 3; j++) {
				if (c[0][i] - c[0][j] == c[1][i] - c[1][j] && c[1][i] - c[1][j] == c[2][i] - c[2][j]) {

				} else {
					b = false;
					break loop;
				}
			}
		}

		if (b) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) StringBuilder sb = new StringBuilder(); sb new StringBuilder() 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] = 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 if (b) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		} b {
			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) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		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] = sc.nextInt();
			}
		}
		loop: for (int i = 0; i < 2; i++) {
			for (int j = i + 1; j < 3; j++) {
				if (c[i][0] - c[j][0] == c[i][1] - c[j][1] && c[i][1] - c[j][1] == c[i][2] - c[j][2]) {

				} else {
					b = false;
					break loop;
				}
			}
		}

		loop: for (int i = 0; i < 2; i++) {
			for (int j = i + 1; j < 3; j++) {
				if (c[0][i] - c[0][j] == c[1][i] - c[1][j] && c[1][i] - c[1][j] == c[2][i] - c[2][j]) {

				} else {
					b = false;
					break loop;
				}
			}
		}

		if (b) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		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] = sc.nextInt();
			}
		}
		loop: for (int i = 0; i < 2; i++) {
			for (int j = i + 1; j < 3; j++) {
				if (c[i][0] - c[j][0] == c[i][1] - c[j][1] && c[i][1] - c[j][1] == c[i][2] - c[j][2]) {

				} else {
					b = false;
					break loop;
				}
			}
		}

		loop: for (int i = 0; i < 2; i++) {
			for (int j = i + 1; j < 3; j++) {
				if (c[0][i] - c[0][j] == c[1][i] - c[1][j] && c[1][i] - c[1][j] == c[2][i] - c[2][j]) {

				} else {
					b = false;
					break loop;
				}
			}
		}

		if (b) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		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] = sc.nextInt();
			}
		}
		loop: for (int i = 0; i < 2; i++) {
			for (int j = i + 1; j < 3; j++) {
				if (c[i][0] - c[j][0] == c[i][1] - c[j][1] && c[i][1] - c[j][1] == c[i][2] - c[j][2]) {

				} else {
					b = false;
					break loop;
				}
			}
		}

		loop: for (int i = 0; i < 2; i++) {
			for (int j = i + 1; j < 3; j++) {
				if (c[0][i] - c[0][j] == c[1][i] - c[1][j] && c[1][i] - c[1][j] == c[2][i] - c[2][j]) {

				} else {
					b = false;
					break loop;
				}
			}
		}

		if (b) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

	}
}
