import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner((System.in));
		int[] x = new int[3];
		int[] y = new int[3];
		int[] z = new int[3];
		String ans = "No";

		for (int i = 0; i < 3; i++) {
			x[i] = sc.nextInt();
		}
		for (int i = 0; i < 3; i++) {
			y[i] = sc.nextInt();
		}
		for (int i = 0; i < 3; i++) {
			z[i] = sc.nextInt();
		}
		
		if (x[0] - x[1] == y[0] - y[1] && z[0] - z[1] == y[0] - y[1] && x[0] - x[1] == z[0] - z[1]) {
			if (x[1] - x[2] == y[1] - y[2] && z[1] - z[2] == y[1] - y[2] && x[1] - x[2] == z[1] - z[2]) {
				if (x[2] - x[0] == y[2] - y[0] && z[2] - z[0] == y[2] - y[0] && x[2] - x[0] == z[2] - z[0]) {
					ans = "Yes";
				}
			}
		}

		System.out.println(ans);

		sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner((System.in));
		int[] x = new int[3];
		int[] y = new int[3];
		int[] z = new int[3];
		String ans = "No";

		for (int i = 0; i < 3; i++) {
			x[i] = sc.nextInt();
		}
		for (int i = 0; i < 3; i++) {
			y[i] = sc.nextInt();
		}
		for (int i = 0; i < 3; i++) {
			z[i] = sc.nextInt();
		}
		
		if (x[0] - x[1] == y[0] - y[1] && z[0] - z[1] == y[0] - y[1] && x[0] - x[1] == z[0] - z[1]) {
			if (x[1] - x[2] == y[1] - y[2] && z[1] - z[2] == y[1] - y[2] && x[1] - x[2] == z[1] - z[2]) {
				if (x[2] - x[0] == y[2] - y[0] && z[2] - z[0] == y[2] - y[0] && x[2] - x[0] == z[2] - z[0]) {
					ans = "Yes";
				}
			}
		}

		System.out.println(ans);

		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner((System.in));
		int[] x = new int[3];
		int[] y = new int[3];
		int[] z = new int[3];
		String ans = "No";

		for (int i = 0; i < 3; i++) {
			x[i] = sc.nextInt();
		}
		for (int i = 0; i < 3; i++) {
			y[i] = sc.nextInt();
		}
		for (int i = 0; i < 3; i++) {
			z[i] = sc.nextInt();
		}
		
		if (x[0] - x[1] == y[0] - y[1] && z[0] - z[1] == y[0] - y[1] && x[0] - x[1] == z[0] - z[1]) {
			if (x[1] - x[2] == y[1] - y[2] && z[1] - z[2] == y[1] - y[2] && x[1] - x[2] == z[1] - z[2]) {
				if (x[2] - x[0] == y[2] - y[0] && z[2] - z[0] == y[2] - y[0] && x[2] - x[0] == z[2] - z[0]) {
					ans = "Yes";
				}
			}
		}

		System.out.println(ans);

		sc.close();
	} main {
		Scanner sc = new Scanner((System.in));
		int[] x = new int[3];
		int[] y = new int[3];
		int[] z = new int[3];
		String ans = "No";

		for (int i = 0; i < 3; i++) {
			x[i] = sc.nextInt();
		}
		for (int i = 0; i < 3; i++) {
			y[i] = sc.nextInt();
		}
		for (int i = 0; i < 3; i++) {
			z[i] = sc.nextInt();
		}
		
		if (x[0] - x[1] == y[0] - y[1] && z[0] - z[1] == y[0] - y[1] && x[0] - x[1] == z[0] - z[1]) {
			if (x[1] - x[2] == y[1] - y[2] && z[1] - z[2] == y[1] - y[2] && x[1] - x[2] == z[1] - z[2]) {
				if (x[2] - x[0] == y[2] - y[0] && z[2] - z[0] == y[2] - y[0] && x[2] - x[0] == z[2] - z[0]) {
					ans = "Yes";
				}
			}
		}

		System.out.println(ans);

		sc.close();
	} Scanner sc = new Scanner((System.in)); sc new Scanner((System.in)) int[] x = new int[3]; x new int[3] 3 int[] y = new int[3]; y new int[3] 3 int[] z = new int[3]; z new int[3] 3 String ans = "No"; ans "No" for (int i = 0; i < 3; i++) {
			x[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			x[i] = sc.nextInt();
		} {
			x[i] = sc.nextInt();
		} x[i] = sc.nextInt() x[i] x i sc.nextInt() sc.nextInt sc for (int i = 0; i < 3; i++) {
			y[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			y[i] = sc.nextInt();
		} {
			y[i] = sc.nextInt();
		} y[i] = sc.nextInt() y[i] y i sc.nextInt() sc.nextInt sc for (int i = 0; i < 3; i++) {
			z[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			z[i] = sc.nextInt();
		} {
			z[i] = sc.nextInt();
		} z[i] = sc.nextInt() z[i] z i sc.nextInt() sc.nextInt sc if (x[0] - x[1] == y[0] - y[1] && z[0] - z[1] == y[0] - y[1] && x[0] - x[1] == z[0] - z[1]) {
			if (x[1] - x[2] == y[1] - y[2] && z[1] - z[2] == y[1] - y[2] && x[1] - x[2] == z[1] - z[2]) {
				if (x[2] - x[0] == y[2] - y[0] && z[2] - z[0] == y[2] - y[0] && x[2] - x[0] == z[2] - z[0]) {
					ans = "Yes";
				}
			}
		} x[0] - x[1] == y[0] - y[1] && z[0] - z[1] == y[0] - y[1] && x[0] - x[1] == z[0] - z[1] x[0] - x[1] == y[0] - y[1] && z[0] - z[1] == y[0] - y[1] && x[0] - x[1] == z[0] - z[1] x[0] - x[1] == y[0] - y[1] x[0] - x[1] x[0] x 0 x[1] x 1 y[0] - y[1] y[0] y 0 y[1] y 1 z[0] - z[1] == y[0] - y[1] z[0] - z[1] z[0] z 0 z[1] z 1 y[0] - y[1] y[0] y 0 y[1] y 1 x[0] - x[1] == z[0] - z[1] x[0] - x[1] x[0] x 0 x[1] x 1 z[0] - z[1] z[0] z 0 z[1] z 1 {
			if (x[1] - x[2] == y[1] - y[2] && z[1] - z[2] == y[1] - y[2] && x[1] - x[2] == z[1] - z[2]) {
				if (x[2] - x[0] == y[2] - y[0] && z[2] - z[0] == y[2] - y[0] && x[2] - x[0] == z[2] - z[0]) {
					ans = "Yes";
				}
			}
		} if (x[1] - x[2] == y[1] - y[2] && z[1] - z[2] == y[1] - y[2] && x[1] - x[2] == z[1] - z[2]) {
				if (x[2] - x[0] == y[2] - y[0] && z[2] - z[0] == y[2] - y[0] && x[2] - x[0] == z[2] - z[0]) {
					ans = "Yes";
				}
			} x[1] - x[2] == y[1] - y[2] && z[1] - z[2] == y[1] - y[2] && x[1] - x[2] == z[1] - z[2] x[1] - x[2] == y[1] - y[2] && z[1] - z[2] == y[1] - y[2] && x[1] - x[2] == z[1] - z[2] x[1] - x[2] == y[1] - y[2] x[1] - x[2] x[1] x 1 x[2] x 2 y[1] - y[2] y[1] y 1 y[2] y 2 z[1] - z[2] == y[1] - y[2] z[1] - z[2] z[1] z 1 z[2] z 2 y[1] - y[2] y[1] y 1 y[2] y 2 x[1] - x[2] == z[1] - z[2] x[1] - x[2] x[1] x 1 x[2] x 2 z[1] - z[2] z[1] z 1 z[2] z 2 {
				if (x[2] - x[0] == y[2] - y[0] && z[2] - z[0] == y[2] - y[0] && x[2] - x[0] == z[2] - z[0]) {
					ans = "Yes";
				}
			} if (x[2] - x[0] == y[2] - y[0] && z[2] - z[0] == y[2] - y[0] && x[2] - x[0] == z[2] - z[0]) {
					ans = "Yes";
				} x[2] - x[0] == y[2] - y[0] && z[2] - z[0] == y[2] - y[0] && x[2] - x[0] == z[2] - z[0] x[2] - x[0] == y[2] - y[0] && z[2] - z[0] == y[2] - y[0] && x[2] - x[0] == z[2] - z[0] x[2] - x[0] == y[2] - y[0] x[2] - x[0] x[2] x 2 x[0] x 0 y[2] - y[0] y[2] y 2 y[0] y 0 z[2] - z[0] == y[2] - y[0] z[2] - z[0] z[2] z 2 z[0] z 0 y[2] - y[0] y[2] y 2 y[0] y 0 x[2] - x[0] == z[2] - z[0] x[2] - x[0] x[2] x 2 x[0] x 0 z[2] - z[0] z[2] z 2 z[0] z 0 {
					ans = "Yes";
				} ans = "Yes" ans "Yes" System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner((System.in));
		int[] x = new int[3];
		int[] y = new int[3];
		int[] z = new int[3];
		String ans = "No";

		for (int i = 0; i < 3; i++) {
			x[i] = sc.nextInt();
		}
		for (int i = 0; i < 3; i++) {
			y[i] = sc.nextInt();
		}
		for (int i = 0; i < 3; i++) {
			z[i] = sc.nextInt();
		}
		
		if (x[0] - x[1] == y[0] - y[1] && z[0] - z[1] == y[0] - y[1] && x[0] - x[1] == z[0] - z[1]) {
			if (x[1] - x[2] == y[1] - y[2] && z[1] - z[2] == y[1] - y[2] && x[1] - x[2] == z[1] - z[2]) {
				if (x[2] - x[0] == y[2] - y[0] && z[2] - z[0] == y[2] - y[0] && x[2] - x[0] == z[2] - z[0]) {
					ans = "Yes";
				}
			}
		}

		System.out.println(ans);

		sc.close();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner((System.in));
		int[] x = new int[3];
		int[] y = new int[3];
		int[] z = new int[3];
		String ans = "No";

		for (int i = 0; i < 3; i++) {
			x[i] = sc.nextInt();
		}
		for (int i = 0; i < 3; i++) {
			y[i] = sc.nextInt();
		}
		for (int i = 0; i < 3; i++) {
			z[i] = sc.nextInt();
		}
		
		if (x[0] - x[1] == y[0] - y[1] && z[0] - z[1] == y[0] - y[1] && x[0] - x[1] == z[0] - z[1]) {
			if (x[1] - x[2] == y[1] - y[2] && z[1] - z[2] == y[1] - y[2] && x[1] - x[2] == z[1] - z[2]) {
				if (x[2] - x[0] == y[2] - y[0] && z[2] - z[0] == y[2] - y[0] && x[2] - x[0] == z[2] - z[0]) {
					ans = "Yes";
				}
			}
		}

		System.out.println(ans);

		sc.close();
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner((System.in));
		int[] x = new int[3];
		int[] y = new int[3];
		int[] z = new int[3];
		String ans = "No";

		for (int i = 0; i < 3; i++) {
			x[i] = sc.nextInt();
		}
		for (int i = 0; i < 3; i++) {
			y[i] = sc.nextInt();
		}
		for (int i = 0; i < 3; i++) {
			z[i] = sc.nextInt();
		}
		
		if (x[0] - x[1] == y[0] - y[1] && z[0] - z[1] == y[0] - y[1] && x[0] - x[1] == z[0] - z[1]) {
			if (x[1] - x[2] == y[1] - y[2] && z[1] - z[2] == y[1] - y[2] && x[1] - x[2] == z[1] - z[2]) {
				if (x[2] - x[0] == y[2] - y[0] && z[2] - z[0] == y[2] - y[0] && x[2] - x[0] == z[2] - z[0]) {
					ans = "Yes";
				}
			}
		}

		System.out.println(ans);

		sc.close();
	}
}
