import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		try (Scanner sc = new Scanner(System.in)) {
			int c0[] = new int[3];
			int c1[] = new int[3];
			int c2[] = new int[3];
			for (int i = 0; i < 3; i++) {
				c0[i] = sc.nextInt();
			}
			for (int i = 0; i < 3; i++) {
				c1[i] = sc.nextInt();
			}
			for (int i = 0; i < 3; i++) {
				c2[i] = sc.nextInt();
			}
			
			int x[] = new int[6];
			int y[] = new int[6];
			for (int i = 0; i < 3; i++) {
				x[i] = c0[i] - c1[i];
				x[i + 3] = c1[i] - c2[i];
			}
			for (int i = 0; i < 2; i++) {
				y[i] = c0[i] - c0[i + 1];
				y[i + 2] = c1[i] - c1[i + 1];
				y[i + 4] = c2[i] - c2[i + 1];
			}
			
			boolean result = true;
			if (x[0] == x[1] && x[1] == x[2]) {} else {
				result = false;
			}
			if (x[3] == x[4] && x[4] == x[5]) {} else {
				result = false;
			}
			if (y[0] == y[2] && y[2] == y[4]) {} else {
				result = false;
			}
			if (y[1] == y[3] && y[3] == y[5]) {} else {
				result = false;
			}
			
			if (result) {
				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 sc = new Scanner(System.in)) {
			int c0[] = new int[3];
			int c1[] = new int[3];
			int c2[] = new int[3];
			for (int i = 0; i < 3; i++) {
				c0[i] = sc.nextInt();
			}
			for (int i = 0; i < 3; i++) {
				c1[i] = sc.nextInt();
			}
			for (int i = 0; i < 3; i++) {
				c2[i] = sc.nextInt();
			}
			
			int x[] = new int[6];
			int y[] = new int[6];
			for (int i = 0; i < 3; i++) {
				x[i] = c0[i] - c1[i];
				x[i + 3] = c1[i] - c2[i];
			}
			for (int i = 0; i < 2; i++) {
				y[i] = c0[i] - c0[i + 1];
				y[i + 2] = c1[i] - c1[i + 1];
				y[i + 4] = c2[i] - c2[i + 1];
			}
			
			boolean result = true;
			if (x[0] == x[1] && x[1] == x[2]) {} else {
				result = false;
			}
			if (x[3] == x[4] && x[4] == x[5]) {} else {
				result = false;
			}
			if (y[0] == y[2] && y[2] == y[4]) {} else {
				result = false;
			}
			if (y[1] == y[3] && y[3] == y[5]) {} else {
				result = false;
			}
			
			if (result) {
				System.out.println("Yes");
			} else {
				System.out.println("No");
			}
			
		}

	}

} Main public static void main(String[] args) {
		
		try (Scanner sc = new Scanner(System.in)) {
			int c0[] = new int[3];
			int c1[] = new int[3];
			int c2[] = new int[3];
			for (int i = 0; i < 3; i++) {
				c0[i] = sc.nextInt();
			}
			for (int i = 0; i < 3; i++) {
				c1[i] = sc.nextInt();
			}
			for (int i = 0; i < 3; i++) {
				c2[i] = sc.nextInt();
			}
			
			int x[] = new int[6];
			int y[] = new int[6];
			for (int i = 0; i < 3; i++) {
				x[i] = c0[i] - c1[i];
				x[i + 3] = c1[i] - c2[i];
			}
			for (int i = 0; i < 2; i++) {
				y[i] = c0[i] - c0[i + 1];
				y[i + 2] = c1[i] - c1[i + 1];
				y[i + 4] = c2[i] - c2[i + 1];
			}
			
			boolean result = true;
			if (x[0] == x[1] && x[1] == x[2]) {} else {
				result = false;
			}
			if (x[3] == x[4] && x[4] == x[5]) {} else {
				result = false;
			}
			if (y[0] == y[2] && y[2] == y[4]) {} else {
				result = false;
			}
			if (y[1] == y[3] && y[3] == y[5]) {} else {
				result = false;
			}
			
			if (result) {
				System.out.println("Yes");
			} else {
				System.out.println("No");
			}
			
		}

	} main {
		
		try (Scanner sc = new Scanner(System.in)) {
			int c0[] = new int[3];
			int c1[] = new int[3];
			int c2[] = new int[3];
			for (int i = 0; i < 3; i++) {
				c0[i] = sc.nextInt();
			}
			for (int i = 0; i < 3; i++) {
				c1[i] = sc.nextInt();
			}
			for (int i = 0; i < 3; i++) {
				c2[i] = sc.nextInt();
			}
			
			int x[] = new int[6];
			int y[] = new int[6];
			for (int i = 0; i < 3; i++) {
				x[i] = c0[i] - c1[i];
				x[i + 3] = c1[i] - c2[i];
			}
			for (int i = 0; i < 2; i++) {
				y[i] = c0[i] - c0[i + 1];
				y[i + 2] = c1[i] - c1[i + 1];
				y[i + 4] = c2[i] - c2[i + 1];
			}
			
			boolean result = true;
			if (x[0] == x[1] && x[1] == x[2]) {} else {
				result = false;
			}
			if (x[3] == x[4] && x[4] == x[5]) {} else {
				result = false;
			}
			if (y[0] == y[2] && y[2] == y[4]) {} else {
				result = false;
			}
			if (y[1] == y[3] && y[3] == y[5]) {} else {
				result = false;
			}
			
			if (result) {
				System.out.println("Yes");
			} else {
				System.out.println("No");
			}
			
		}

	} try (Scanner sc = new Scanner(System.in)) {
			int c0[] = new int[3];
			int c1[] = new int[3];
			int c2[] = new int[3];
			for (int i = 0; i < 3; i++) {
				c0[i] = sc.nextInt();
			}
			for (int i = 0; i < 3; i++) {
				c1[i] = sc.nextInt();
			}
			for (int i = 0; i < 3; i++) {
				c2[i] = sc.nextInt();
			}
			
			int x[] = new int[6];
			int y[] = new int[6];
			for (int i = 0; i < 3; i++) {
				x[i] = c0[i] - c1[i];
				x[i + 3] = c1[i] - c2[i];
			}
			for (int i = 0; i < 2; i++) {
				y[i] = c0[i] - c0[i + 1];
				y[i + 2] = c1[i] - c1[i + 1];
				y[i + 4] = c2[i] - c2[i + 1];
			}
			
			boolean result = true;
			if (x[0] == x[1] && x[1] == x[2]) {} else {
				result = false;
			}
			if (x[3] == x[4] && x[4] == x[5]) {} else {
				result = false;
			}
			if (y[0] == y[2] && y[2] == y[4]) {} else {
				result = false;
			}
			if (y[1] == y[3] && y[3] == y[5]) {} else {
				result = false;
			}
			
			if (result) {
				System.out.println("Yes");
			} else {
				System.out.println("No");
			}
			
		} {
			int c0[] = new int[3];
			int c1[] = new int[3];
			int c2[] = new int[3];
			for (int i = 0; i < 3; i++) {
				c0[i] = sc.nextInt();
			}
			for (int i = 0; i < 3; i++) {
				c1[i] = sc.nextInt();
			}
			for (int i = 0; i < 3; i++) {
				c2[i] = sc.nextInt();
			}
			
			int x[] = new int[6];
			int y[] = new int[6];
			for (int i = 0; i < 3; i++) {
				x[i] = c0[i] - c1[i];
				x[i + 3] = c1[i] - c2[i];
			}
			for (int i = 0; i < 2; i++) {
				y[i] = c0[i] - c0[i + 1];
				y[i + 2] = c1[i] - c1[i + 1];
				y[i + 4] = c2[i] - c2[i + 1];
			}
			
			boolean result = true;
			if (x[0] == x[1] && x[1] == x[2]) {} else {
				result = false;
			}
			if (x[3] == x[4] && x[4] == x[5]) {} else {
				result = false;
			}
			if (y[0] == y[2] && y[2] == y[4]) {} else {
				result = false;
			}
			if (y[1] == y[3] && y[3] == y[5]) {} else {
				result = false;
			}
			
			if (result) {
				System.out.println("Yes");
			} else {
				System.out.println("No");
			}
			
		} Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) int c0[] = new int[3]; c0 new int[3] 3 int c1[] = new int[3]; c1 new int[3] 3 int c2[] = new int[3]; c2 new int[3] 3 for (int i = 0; i < 3; i++) {
				c0[i] = sc.nextInt();
			} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
				c0[i] = sc.nextInt();
			} {
				c0[i] = sc.nextInt();
			} c0[i] = sc.nextInt() c0[i] c0 i sc.nextInt() sc.nextInt sc for (int i = 0; i < 3; i++) {
				c1[i] = sc.nextInt();
			} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
				c1[i] = sc.nextInt();
			} {
				c1[i] = sc.nextInt();
			} c1[i] = sc.nextInt() c1[i] c1 i sc.nextInt() sc.nextInt sc for (int i = 0; i < 3; i++) {
				c2[i] = sc.nextInt();
			} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
				c2[i] = sc.nextInt();
			} {
				c2[i] = sc.nextInt();
			} c2[i] = sc.nextInt() c2[i] c2 i sc.nextInt() sc.nextInt sc int x[] = new int[6]; x new int[6] 6 int y[] = new int[6]; y new int[6] 6 for (int i = 0; i < 3; i++) {
				x[i] = c0[i] - c1[i];
				x[i + 3] = c1[i] - c2[i];
			} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
				x[i] = c0[i] - c1[i];
				x[i + 3] = c1[i] - c2[i];
			} {
				x[i] = c0[i] - c1[i];
				x[i + 3] = c1[i] - c2[i];
			} x[i] = c0[i] - c1[i] x[i] x i c0[i] - c1[i] c0[i] c0 i c1[i] c1 i x[i + 3] = c1[i] - c2[i] x[i + 3] x i + 3 i 3 c1[i] - c2[i] c1[i] c1 i c2[i] c2 i for (int i = 0; i < 2; i++) {
				y[i] = c0[i] - c0[i + 1];
				y[i + 2] = c1[i] - c1[i + 1];
				y[i + 4] = c2[i] - c2[i + 1];
			} int i = 0; int i = 0; i 0 i < 2 i 2 i++ i++ i {
				y[i] = c0[i] - c0[i + 1];
				y[i + 2] = c1[i] - c1[i + 1];
				y[i + 4] = c2[i] - c2[i + 1];
			} {
				y[i] = c0[i] - c0[i + 1];
				y[i + 2] = c1[i] - c1[i + 1];
				y[i + 4] = c2[i] - c2[i + 1];
			} y[i] = c0[i] - c0[i + 1] y[i] y i c0[i] - c0[i + 1] c0[i] c0 i c0[i + 1] c0 i + 1 i 1 y[i + 2] = c1[i] - c1[i + 1] y[i + 2] y i + 2 i 2 c1[i] - c1[i + 1] c1[i] c1 i c1[i + 1] c1 i + 1 i 1 y[i + 4] = c2[i] - c2[i + 1] y[i + 4] y i + 4 i 4 c2[i] - c2[i + 1] c2[i] c2 i c2[i + 1] c2 i + 1 i 1 boolean result = true; result true if (x[0] == x[1] && x[1] == x[2]) {} else {
				result = false;
			} x[0] == x[1] && x[1] == x[2] x[0] == x[1] x[0] x 0 x[1] x 1 x[1] == x[2] x[1] x 1 x[2] x 2 {} {
				result = false;
			} result = false result false if (x[3] == x[4] && x[4] == x[5]) {} else {
				result = false;
			} x[3] == x[4] && x[4] == x[5] x[3] == x[4] x[3] x 3 x[4] x 4 x[4] == x[5] x[4] x 4 x[5] x 5 {} {
				result = false;
			} result = false result false if (y[0] == y[2] && y[2] == y[4]) {} else {
				result = false;
			} y[0] == y[2] && y[2] == y[4] y[0] == y[2] y[0] y 0 y[2] y 2 y[2] == y[4] y[2] y 2 y[4] y 4 {} {
				result = false;
			} result = false result false if (y[1] == y[3] && y[3] == y[5]) {} else {
				result = false;
			} y[1] == y[3] && y[3] == y[5] y[1] == y[3] y[1] y 1 y[3] y 3 y[3] == y[5] y[3] y 3 y[5] y 5 {} {
				result = false;
			} result = false result false if (result) {
				System.out.println("Yes");
			} else {
				System.out.println("No");
			} result {
				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 sc = new Scanner(System.in)) {
			int c0[] = new int[3];
			int c1[] = new int[3];
			int c2[] = new int[3];
			for (int i = 0; i < 3; i++) {
				c0[i] = sc.nextInt();
			}
			for (int i = 0; i < 3; i++) {
				c1[i] = sc.nextInt();
			}
			for (int i = 0; i < 3; i++) {
				c2[i] = sc.nextInt();
			}
			
			int x[] = new int[6];
			int y[] = new int[6];
			for (int i = 0; i < 3; i++) {
				x[i] = c0[i] - c1[i];
				x[i + 3] = c1[i] - c2[i];
			}
			for (int i = 0; i < 2; i++) {
				y[i] = c0[i] - c0[i + 1];
				y[i + 2] = c1[i] - c1[i + 1];
				y[i + 4] = c2[i] - c2[i + 1];
			}
			
			boolean result = true;
			if (x[0] == x[1] && x[1] == x[2]) {} else {
				result = false;
			}
			if (x[3] == x[4] && x[4] == x[5]) {} else {
				result = false;
			}
			if (y[0] == y[2] && y[2] == y[4]) {} else {
				result = false;
			}
			if (y[1] == y[3] && y[3] == y[5]) {} else {
				result = false;
			}
			
			if (result) {
				System.out.println("Yes");
			} else {
				System.out.println("No");
			}
			
		}

	}

} public class Main {

	public static void main(String[] args) {
		
		try (Scanner sc = new Scanner(System.in)) {
			int c0[] = new int[3];
			int c1[] = new int[3];
			int c2[] = new int[3];
			for (int i = 0; i < 3; i++) {
				c0[i] = sc.nextInt();
			}
			for (int i = 0; i < 3; i++) {
				c1[i] = sc.nextInt();
			}
			for (int i = 0; i < 3; i++) {
				c2[i] = sc.nextInt();
			}
			
			int x[] = new int[6];
			int y[] = new int[6];
			for (int i = 0; i < 3; i++) {
				x[i] = c0[i] - c1[i];
				x[i + 3] = c1[i] - c2[i];
			}
			for (int i = 0; i < 2; i++) {
				y[i] = c0[i] - c0[i + 1];
				y[i + 2] = c1[i] - c1[i + 1];
				y[i + 4] = c2[i] - c2[i + 1];
			}
			
			boolean result = true;
			if (x[0] == x[1] && x[1] == x[2]) {} else {
				result = false;
			}
			if (x[3] == x[4] && x[4] == x[5]) {} else {
				result = false;
			}
			if (y[0] == y[2] && y[2] == y[4]) {} else {
				result = false;
			}
			if (y[1] == y[3] && y[3] == y[5]) {} else {
				result = false;
			}
			
			if (result) {
				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 sc = new Scanner(System.in)) {
			int c0[] = new int[3];
			int c1[] = new int[3];
			int c2[] = new int[3];
			for (int i = 0; i < 3; i++) {
				c0[i] = sc.nextInt();
			}
			for (int i = 0; i < 3; i++) {
				c1[i] = sc.nextInt();
			}
			for (int i = 0; i < 3; i++) {
				c2[i] = sc.nextInt();
			}
			
			int x[] = new int[6];
			int y[] = new int[6];
			for (int i = 0; i < 3; i++) {
				x[i] = c0[i] - c1[i];
				x[i + 3] = c1[i] - c2[i];
			}
			for (int i = 0; i < 2; i++) {
				y[i] = c0[i] - c0[i + 1];
				y[i + 2] = c1[i] - c1[i + 1];
				y[i + 4] = c2[i] - c2[i + 1];
			}
			
			boolean result = true;
			if (x[0] == x[1] && x[1] == x[2]) {} else {
				result = false;
			}
			if (x[3] == x[4] && x[4] == x[5]) {} else {
				result = false;
			}
			if (y[0] == y[2] && y[2] == y[4]) {} else {
				result = false;
			}
			if (y[1] == y[3] && y[3] == y[5]) {} else {
				result = false;
			}
			
			if (result) {
				System.out.println("Yes");
			} else {
				System.out.println("No");
			}
			
		}

	}

}