import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int c1 = sc.nextInt();
		int c2= sc.nextInt();
		int c3 = sc.nextInt();
		int c4 = sc.nextInt();
		int c5 = sc.nextInt();
		int c6 = sc.nextInt();
		int c7 = sc.nextInt();
		int c8 = sc.nextInt();
		int c9 = sc.nextInt();

		int flag = 0;

		ArrayList<Integer> Aarray = new ArrayList<Integer>();
		for (int i = 0; i < 3; i++) {
			Aarray.add(0);
		}
		ArrayList<Integer> Barray = new ArrayList<Integer>();
		for (int i = 0; i < 3; i++) {
			Barray.add(0);
		}

		loop: for (int i = 0; i < 100; i++) {
			Aarray.set(0, i);
			Barray.set(0, c1 - Aarray.get(0));
			Barray.set(1, c2 - Aarray.get(0));
			Barray.set(2, c3 - Aarray.get(0));

			for (int j = 0; j < 2; j++) {
				Aarray.set(1, c4 - Barray.get(j));

				for (int k = 0; k < 2; k ++) {
					Aarray.set(2, c7 - Barray.get(k));

					if (Aarray.get(1) + Barray.get(1) == c5
							&& Aarray.get(1) + Barray.get(2) == c6
							&& Aarray.get(2) + Barray.get(1) == c8
							&& Aarray.get(2) + Barray.get(2) == c9) {

						flag ++;
						break loop;
					}
				}
			}

		}
		if (flag == 1) {
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
	}

} import java.util.ArrayList; ArrayList java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int c1 = sc.nextInt();
		int c2= sc.nextInt();
		int c3 = sc.nextInt();
		int c4 = sc.nextInt();
		int c5 = sc.nextInt();
		int c6 = sc.nextInt();
		int c7 = sc.nextInt();
		int c8 = sc.nextInt();
		int c9 = sc.nextInt();

		int flag = 0;

		ArrayList<Integer> Aarray = new ArrayList<Integer>();
		for (int i = 0; i < 3; i++) {
			Aarray.add(0);
		}
		ArrayList<Integer> Barray = new ArrayList<Integer>();
		for (int i = 0; i < 3; i++) {
			Barray.add(0);
		}

		loop: for (int i = 0; i < 100; i++) {
			Aarray.set(0, i);
			Barray.set(0, c1 - Aarray.get(0));
			Barray.set(1, c2 - Aarray.get(0));
			Barray.set(2, c3 - Aarray.get(0));

			for (int j = 0; j < 2; j++) {
				Aarray.set(1, c4 - Barray.get(j));

				for (int k = 0; k < 2; k ++) {
					Aarray.set(2, c7 - Barray.get(k));

					if (Aarray.get(1) + Barray.get(1) == c5
							&& Aarray.get(1) + Barray.get(2) == c6
							&& Aarray.get(2) + Barray.get(1) == c8
							&& Aarray.get(2) + Barray.get(2) == c9) {

						flag ++;
						break loop;
					}
				}
			}

		}
		if (flag == 1) {
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int c1 = sc.nextInt();
		int c2= sc.nextInt();
		int c3 = sc.nextInt();
		int c4 = sc.nextInt();
		int c5 = sc.nextInt();
		int c6 = sc.nextInt();
		int c7 = sc.nextInt();
		int c8 = sc.nextInt();
		int c9 = sc.nextInt();

		int flag = 0;

		ArrayList<Integer> Aarray = new ArrayList<Integer>();
		for (int i = 0; i < 3; i++) {
			Aarray.add(0);
		}
		ArrayList<Integer> Barray = new ArrayList<Integer>();
		for (int i = 0; i < 3; i++) {
			Barray.add(0);
		}

		loop: for (int i = 0; i < 100; i++) {
			Aarray.set(0, i);
			Barray.set(0, c1 - Aarray.get(0));
			Barray.set(1, c2 - Aarray.get(0));
			Barray.set(2, c3 - Aarray.get(0));

			for (int j = 0; j < 2; j++) {
				Aarray.set(1, c4 - Barray.get(j));

				for (int k = 0; k < 2; k ++) {
					Aarray.set(2, c7 - Barray.get(k));

					if (Aarray.get(1) + Barray.get(1) == c5
							&& Aarray.get(1) + Barray.get(2) == c6
							&& Aarray.get(2) + Barray.get(1) == c8
							&& Aarray.get(2) + Barray.get(2) == c9) {

						flag ++;
						break loop;
					}
				}
			}

		}
		if (flag == 1) {
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
	} main {
		Scanner sc = new Scanner(System.in);

		int c1 = sc.nextInt();
		int c2= sc.nextInt();
		int c3 = sc.nextInt();
		int c4 = sc.nextInt();
		int c5 = sc.nextInt();
		int c6 = sc.nextInt();
		int c7 = sc.nextInt();
		int c8 = sc.nextInt();
		int c9 = sc.nextInt();

		int flag = 0;

		ArrayList<Integer> Aarray = new ArrayList<Integer>();
		for (int i = 0; i < 3; i++) {
			Aarray.add(0);
		}
		ArrayList<Integer> Barray = new ArrayList<Integer>();
		for (int i = 0; i < 3; i++) {
			Barray.add(0);
		}

		loop: for (int i = 0; i < 100; i++) {
			Aarray.set(0, i);
			Barray.set(0, c1 - Aarray.get(0));
			Barray.set(1, c2 - Aarray.get(0));
			Barray.set(2, c3 - Aarray.get(0));

			for (int j = 0; j < 2; j++) {
				Aarray.set(1, c4 - Barray.get(j));

				for (int k = 0; k < 2; k ++) {
					Aarray.set(2, c7 - Barray.get(k));

					if (Aarray.get(1) + Barray.get(1) == c5
							&& Aarray.get(1) + Barray.get(2) == c6
							&& Aarray.get(2) + Barray.get(1) == c8
							&& Aarray.get(2) + Barray.get(2) == c9) {

						flag ++;
						break loop;
					}
				}
			}

		}
		if (flag == 1) {
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int c1 = sc.nextInt(); c1 sc.nextInt() sc.nextInt sc int c2= sc.nextInt(); c2 sc.nextInt() sc.nextInt sc int c3 = sc.nextInt(); c3 sc.nextInt() sc.nextInt sc int c4 = sc.nextInt(); c4 sc.nextInt() sc.nextInt sc int c5 = sc.nextInt(); c5 sc.nextInt() sc.nextInt sc int c6 = sc.nextInt(); c6 sc.nextInt() sc.nextInt sc int c7 = sc.nextInt(); c7 sc.nextInt() sc.nextInt sc int c8 = sc.nextInt(); c8 sc.nextInt() sc.nextInt sc int c9 = sc.nextInt(); c9 sc.nextInt() sc.nextInt sc int flag = 0; flag 0 ArrayList<Integer> Aarray = new ArrayList<Integer>(); Aarray new ArrayList<Integer>() for (int i = 0; i < 3; i++) {
			Aarray.add(0);
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			Aarray.add(0);
		} {
			Aarray.add(0);
		} Aarray.add(0) Aarray.add Aarray 0 ArrayList<Integer> Barray = new ArrayList<Integer>(); Barray new ArrayList<Integer>() for (int i = 0; i < 3; i++) {
			Barray.add(0);
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			Barray.add(0);
		} {
			Barray.add(0);
		} Barray.add(0) Barray.add Barray 0 if (flag == 1) {
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		} flag == 1 flag 1 {
			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);

		int c1 = sc.nextInt();
		int c2= sc.nextInt();
		int c3 = sc.nextInt();
		int c4 = sc.nextInt();
		int c5 = sc.nextInt();
		int c6 = sc.nextInt();
		int c7 = sc.nextInt();
		int c8 = sc.nextInt();
		int c9 = sc.nextInt();

		int flag = 0;

		ArrayList<Integer> Aarray = new ArrayList<Integer>();
		for (int i = 0; i < 3; i++) {
			Aarray.add(0);
		}
		ArrayList<Integer> Barray = new ArrayList<Integer>();
		for (int i = 0; i < 3; i++) {
			Barray.add(0);
		}

		loop: for (int i = 0; i < 100; i++) {
			Aarray.set(0, i);
			Barray.set(0, c1 - Aarray.get(0));
			Barray.set(1, c2 - Aarray.get(0));
			Barray.set(2, c3 - Aarray.get(0));

			for (int j = 0; j < 2; j++) {
				Aarray.set(1, c4 - Barray.get(j));

				for (int k = 0; k < 2; k ++) {
					Aarray.set(2, c7 - Barray.get(k));

					if (Aarray.get(1) + Barray.get(1) == c5
							&& Aarray.get(1) + Barray.get(2) == c6
							&& Aarray.get(2) + Barray.get(1) == c8
							&& Aarray.get(2) + Barray.get(2) == c9) {

						flag ++;
						break loop;
					}
				}
			}

		}
		if (flag == 1) {
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int c1 = sc.nextInt();
		int c2= sc.nextInt();
		int c3 = sc.nextInt();
		int c4 = sc.nextInt();
		int c5 = sc.nextInt();
		int c6 = sc.nextInt();
		int c7 = sc.nextInt();
		int c8 = sc.nextInt();
		int c9 = sc.nextInt();

		int flag = 0;

		ArrayList<Integer> Aarray = new ArrayList<Integer>();
		for (int i = 0; i < 3; i++) {
			Aarray.add(0);
		}
		ArrayList<Integer> Barray = new ArrayList<Integer>();
		for (int i = 0; i < 3; i++) {
			Barray.add(0);
		}

		loop: for (int i = 0; i < 100; i++) {
			Aarray.set(0, i);
			Barray.set(0, c1 - Aarray.get(0));
			Barray.set(1, c2 - Aarray.get(0));
			Barray.set(2, c3 - Aarray.get(0));

			for (int j = 0; j < 2; j++) {
				Aarray.set(1, c4 - Barray.get(j));

				for (int k = 0; k < 2; k ++) {
					Aarray.set(2, c7 - Barray.get(k));

					if (Aarray.get(1) + Barray.get(1) == c5
							&& Aarray.get(1) + Barray.get(2) == c6
							&& Aarray.get(2) + Barray.get(1) == c8
							&& Aarray.get(2) + Barray.get(2) == c9) {

						flag ++;
						break loop;
					}
				}
			}

		}
		if (flag == 1) {
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
	}

} Main
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int c1 = sc.nextInt();
		int c2= sc.nextInt();
		int c3 = sc.nextInt();
		int c4 = sc.nextInt();
		int c5 = sc.nextInt();
		int c6 = sc.nextInt();
		int c7 = sc.nextInt();
		int c8 = sc.nextInt();
		int c9 = sc.nextInt();

		int flag = 0;

		ArrayList<Integer> Aarray = new ArrayList<Integer>();
		for (int i = 0; i < 3; i++) {
			Aarray.add(0);
		}
		ArrayList<Integer> Barray = new ArrayList<Integer>();
		for (int i = 0; i < 3; i++) {
			Barray.add(0);
		}

		loop: for (int i = 0; i < 100; i++) {
			Aarray.set(0, i);
			Barray.set(0, c1 - Aarray.get(0));
			Barray.set(1, c2 - Aarray.get(0));
			Barray.set(2, c3 - Aarray.get(0));

			for (int j = 0; j < 2; j++) {
				Aarray.set(1, c4 - Barray.get(j));

				for (int k = 0; k < 2; k ++) {
					Aarray.set(2, c7 - Barray.get(k));

					if (Aarray.get(1) + Barray.get(1) == c5
							&& Aarray.get(1) + Barray.get(2) == c6
							&& Aarray.get(2) + Barray.get(1) == c8
							&& Aarray.get(2) + Barray.get(2) == c9) {

						flag ++;
						break loop;
					}
				}
			}

		}
		if (flag == 1) {
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
	}

}
