import java.util.*;

public class Main {
	public static void main(String... args) {
		Scanner sc = new Scanner(System.in);
		int[][] c = new int[3][3];
		for (int i = 0 ; i < 3 ; i++) {
			c[0][i] = sc.nextInt();
			c[1][i] = sc.nextInt();
			c[2][i] = sc.nextInt();
		}

		for (int i = 1 ; i < 3 ; i++) {
			for (int j = 1 ; j < 3 ; j++) {
				if (c[i-1][j-1] - c[i][j-1] != c[i-1][j] - c[i][j]) {
					System.out.println("No");
					System.exit(0);
				}
			}
		}
		System.out.println("Yes");
	}
} 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];
		for (int i = 0 ; i < 3 ; i++) {
			c[0][i] = sc.nextInt();
			c[1][i] = sc.nextInt();
			c[2][i] = sc.nextInt();
		}

		for (int i = 1 ; i < 3 ; i++) {
			for (int j = 1 ; j < 3 ; j++) {
				if (c[i-1][j-1] - c[i][j-1] != c[i-1][j] - c[i][j]) {
					System.out.println("No");
					System.exit(0);
				}
			}
		}
		System.out.println("Yes");
	}
} Main public static void main(String... args) {
		Scanner sc = new Scanner(System.in);
		int[][] c = new int[3][3];
		for (int i = 0 ; i < 3 ; i++) {
			c[0][i] = sc.nextInt();
			c[1][i] = sc.nextInt();
			c[2][i] = sc.nextInt();
		}

		for (int i = 1 ; i < 3 ; i++) {
			for (int j = 1 ; j < 3 ; j++) {
				if (c[i-1][j-1] - c[i][j-1] != c[i-1][j] - c[i][j]) {
					System.out.println("No");
					System.exit(0);
				}
			}
		}
		System.out.println("Yes");
	} main {
		Scanner sc = new Scanner(System.in);
		int[][] c = new int[3][3];
		for (int i = 0 ; i < 3 ; i++) {
			c[0][i] = sc.nextInt();
			c[1][i] = sc.nextInt();
			c[2][i] = sc.nextInt();
		}

		for (int i = 1 ; i < 3 ; i++) {
			for (int j = 1 ; j < 3 ; j++) {
				if (c[i-1][j-1] - c[i][j-1] != c[i-1][j] - c[i][j]) {
					System.out.println("No");
					System.exit(0);
				}
			}
		}
		System.out.println("Yes");
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[][] c = new int[3][3]; c new int[3][3] 3 3 for (int i = 0 ; i < 3 ; i++) {
			c[0][i] = sc.nextInt();
			c[1][i] = sc.nextInt();
			c[2][i] = sc.nextInt();
		} int i = 0 ; int i = 0 ; i 0 i < 3 i 3 i++ i++ i {
			c[0][i] = sc.nextInt();
			c[1][i] = sc.nextInt();
			c[2][i] = sc.nextInt();
		} {
			c[0][i] = sc.nextInt();
			c[1][i] = sc.nextInt();
			c[2][i] = sc.nextInt();
		} c[0][i] = sc.nextInt() c[0][i] c[0] c 0 i sc.nextInt() sc.nextInt sc c[1][i] = sc.nextInt() c[1][i] c[1] c 1 i sc.nextInt() sc.nextInt sc c[2][i] = sc.nextInt() c[2][i] c[2] c 2 i sc.nextInt() sc.nextInt sc for (int i = 1 ; i < 3 ; i++) {
			for (int j = 1 ; j < 3 ; j++) {
				if (c[i-1][j-1] - c[i][j-1] != c[i-1][j] - c[i][j]) {
					System.out.println("No");
					System.exit(0);
				}
			}
		} int i = 1 ; int i = 1 ; i 1 i < 3 i 3 i++ i++ i {
			for (int j = 1 ; j < 3 ; j++) {
				if (c[i-1][j-1] - c[i][j-1] != c[i-1][j] - c[i][j]) {
					System.out.println("No");
					System.exit(0);
				}
			}
		} {
			for (int j = 1 ; j < 3 ; j++) {
				if (c[i-1][j-1] - c[i][j-1] != c[i-1][j] - c[i][j]) {
					System.out.println("No");
					System.exit(0);
				}
			}
		} for (int j = 1 ; j < 3 ; j++) {
				if (c[i-1][j-1] - c[i][j-1] != c[i-1][j] - c[i][j]) {
					System.out.println("No");
					System.exit(0);
				}
			} int j = 1 ; int j = 1 ; j 1 j < 3 j 3 j++ j++ j {
				if (c[i-1][j-1] - c[i][j-1] != c[i-1][j] - c[i][j]) {
					System.out.println("No");
					System.exit(0);
				}
			} {
				if (c[i-1][j-1] - c[i][j-1] != c[i-1][j] - c[i][j]) {
					System.out.println("No");
					System.exit(0);
				}
			} if (c[i-1][j-1] - c[i][j-1] != c[i-1][j] - c[i][j]) {
					System.out.println("No");
					System.exit(0);
				} c[i-1][j-1] - c[i][j-1] != c[i-1][j] - c[i][j] c[i-1][j-1] - c[i][j-1] c[i-1][j-1] c[i-1] c i-1 i 1 j-1 j 1 c[i][j-1] c[i] c i j-1 j 1 c[i-1][j] - c[i][j] c[i-1][j] c[i-1] c i-1 i 1 j c[i][j] c[i] c i j {
					System.out.println("No");
					System.exit(0);
				} System.out.println("No") System.out.println System.out System System.out "No" System.exit(0) System.exit System 0 System.out.println("Yes") System.out.println System.out System System.out "Yes" String... args args public class Main {
	public static void main(String... args) {
		Scanner sc = new Scanner(System.in);
		int[][] c = new int[3][3];
		for (int i = 0 ; i < 3 ; i++) {
			c[0][i] = sc.nextInt();
			c[1][i] = sc.nextInt();
			c[2][i] = sc.nextInt();
		}

		for (int i = 1 ; i < 3 ; i++) {
			for (int j = 1 ; j < 3 ; j++) {
				if (c[i-1][j-1] - c[i][j-1] != c[i-1][j] - c[i][j]) {
					System.out.println("No");
					System.exit(0);
				}
			}
		}
		System.out.println("Yes");
	}
} public class Main {
	public static void main(String... args) {
		Scanner sc = new Scanner(System.in);
		int[][] c = new int[3][3];
		for (int i = 0 ; i < 3 ; i++) {
			c[0][i] = sc.nextInt();
			c[1][i] = sc.nextInt();
			c[2][i] = sc.nextInt();
		}

		for (int i = 1 ; i < 3 ; i++) {
			for (int j = 1 ; j < 3 ; j++) {
				if (c[i-1][j-1] - c[i][j-1] != c[i-1][j] - c[i][j]) {
					System.out.println("No");
					System.exit(0);
				}
			}
		}
		System.out.println("Yes");
	}
} 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];
		for (int i = 0 ; i < 3 ; i++) {
			c[0][i] = sc.nextInt();
			c[1][i] = sc.nextInt();
			c[2][i] = sc.nextInt();
		}

		for (int i = 1 ; i < 3 ; i++) {
			for (int j = 1 ; j < 3 ; j++) {
				if (c[i-1][j-1] - c[i][j-1] != c[i-1][j] - c[i][j]) {
					System.out.println("No");
					System.exit(0);
				}
			}
		}
		System.out.println("Yes");
	}
}
