import java.util.*;

public class Main {

	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int[][] grid = new int[3][3];
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				grid[i][j] = sc.nextInt();
			}
		}
		int[] x12 = new int[3];
		int[] x13 = new int[3];
		int[] x23 = new int[3];
		int[] y12 = new int[3];
		int[] y13 = new int[3];
		int[] y23 = new int[3];
		
		for (int i = 0; i < 3; i++) {
			x12[i] = grid[i][0] - grid[i][1];
			x13[i] = grid[i][0] - grid[i][2];
			x23[i] = grid[i][1] - grid[i][2];
			y12[i] = grid[0][i] - grid[1][i];
			y13[i] = grid[0][i] - grid[2][i];
			y23[i] = grid[1][i] - grid[2][i];
		}
		boolean flag = true;
		for (int i = 0; i < 2; i++) {
			for (int j = i + 1; j < 3; j++) {
				if (x12[i] != x12[j]) {
					flag = false;
					break;
				}
				if (x13[i] != x13[j]) {
					flag = false;
					break;
				}
				if (x23[i] != x23[j]) {
					flag = false;
					break;
				}
				if (y12[i] != y12[j]) {
					flag = false;
					break;
				}
				if (y13[i] != y13[j]) {
					flag = false;
					break;
				}
				if (y23[i] != y23[j]) {
					flag = false;
					break;
				}
			}
			if (!flag) {
				break;
			}
		}
		if (flag) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
} import java.util.*; util.* java public class Main {

	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int[][] grid = new int[3][3];
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				grid[i][j] = sc.nextInt();
			}
		}
		int[] x12 = new int[3];
		int[] x13 = new int[3];
		int[] x23 = new int[3];
		int[] y12 = new int[3];
		int[] y13 = new int[3];
		int[] y23 = new int[3];
		
		for (int i = 0; i < 3; i++) {
			x12[i] = grid[i][0] - grid[i][1];
			x13[i] = grid[i][0] - grid[i][2];
			x23[i] = grid[i][1] - grid[i][2];
			y12[i] = grid[0][i] - grid[1][i];
			y13[i] = grid[0][i] - grid[2][i];
			y23[i] = grid[1][i] - grid[2][i];
		}
		boolean flag = true;
		for (int i = 0; i < 2; i++) {
			for (int j = i + 1; j < 3; j++) {
				if (x12[i] != x12[j]) {
					flag = false;
					break;
				}
				if (x13[i] != x13[j]) {
					flag = false;
					break;
				}
				if (x23[i] != x23[j]) {
					flag = false;
					break;
				}
				if (y12[i] != y12[j]) {
					flag = false;
					break;
				}
				if (y13[i] != y13[j]) {
					flag = false;
					break;
				}
				if (y23[i] != y23[j]) {
					flag = false;
					break;
				}
			}
			if (!flag) {
				break;
			}
		}
		if (flag) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int[][] grid = new int[3][3];
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				grid[i][j] = sc.nextInt();
			}
		}
		int[] x12 = new int[3];
		int[] x13 = new int[3];
		int[] x23 = new int[3];
		int[] y12 = new int[3];
		int[] y13 = new int[3];
		int[] y23 = new int[3];
		
		for (int i = 0; i < 3; i++) {
			x12[i] = grid[i][0] - grid[i][1];
			x13[i] = grid[i][0] - grid[i][2];
			x23[i] = grid[i][1] - grid[i][2];
			y12[i] = grid[0][i] - grid[1][i];
			y13[i] = grid[0][i] - grid[2][i];
			y23[i] = grid[1][i] - grid[2][i];
		}
		boolean flag = true;
		for (int i = 0; i < 2; i++) {
			for (int j = i + 1; j < 3; j++) {
				if (x12[i] != x12[j]) {
					flag = false;
					break;
				}
				if (x13[i] != x13[j]) {
					flag = false;
					break;
				}
				if (x23[i] != x23[j]) {
					flag = false;
					break;
				}
				if (y12[i] != y12[j]) {
					flag = false;
					break;
				}
				if (y13[i] != y13[j]) {
					flag = false;
					break;
				}
				if (y23[i] != y23[j]) {
					flag = false;
					break;
				}
			}
			if (!flag) {
				break;
			}
		}
		if (flag) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int[][] grid = new int[3][3];
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				grid[i][j] = sc.nextInt();
			}
		}
		int[] x12 = new int[3];
		int[] x13 = new int[3];
		int[] x23 = new int[3];
		int[] y12 = new int[3];
		int[] y13 = new int[3];
		int[] y23 = new int[3];
		
		for (int i = 0; i < 3; i++) {
			x12[i] = grid[i][0] - grid[i][1];
			x13[i] = grid[i][0] - grid[i][2];
			x23[i] = grid[i][1] - grid[i][2];
			y12[i] = grid[0][i] - grid[1][i];
			y13[i] = grid[0][i] - grid[2][i];
			y23[i] = grid[1][i] - grid[2][i];
		}
		boolean flag = true;
		for (int i = 0; i < 2; i++) {
			for (int j = i + 1; j < 3; j++) {
				if (x12[i] != x12[j]) {
					flag = false;
					break;
				}
				if (x13[i] != x13[j]) {
					flag = false;
					break;
				}
				if (x23[i] != x23[j]) {
					flag = false;
					break;
				}
				if (y12[i] != y12[j]) {
					flag = false;
					break;
				}
				if (y13[i] != y13[j]) {
					flag = false;
					break;
				}
				if (y23[i] != y23[j]) {
					flag = false;
					break;
				}
			}
			if (!flag) {
				break;
			}
		}
		if (flag) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[][] grid = new int[3][3]; grid new int[3][3] 3 3 for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				grid[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++) {
				grid[i][j] = sc.nextInt();
			}
		} {
			for (int j = 0; j < 3; j++) {
				grid[i][j] = sc.nextInt();
			}
		} for (int j = 0; j < 3; j++) {
				grid[i][j] = sc.nextInt();
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				grid[i][j] = sc.nextInt();
			} {
				grid[i][j] = sc.nextInt();
			} grid[i][j] = sc.nextInt() grid[i][j] grid[i] grid i j sc.nextInt() sc.nextInt sc int[] x12 = new int[3]; x12 new int[3] 3 int[] x13 = new int[3]; x13 new int[3] 3 int[] x23 = new int[3]; x23 new int[3] 3 int[] y12 = new int[3]; y12 new int[3] 3 int[] y13 = new int[3]; y13 new int[3] 3 int[] y23 = new int[3]; y23 new int[3] 3 for (int i = 0; i < 3; i++) {
			x12[i] = grid[i][0] - grid[i][1];
			x13[i] = grid[i][0] - grid[i][2];
			x23[i] = grid[i][1] - grid[i][2];
			y12[i] = grid[0][i] - grid[1][i];
			y13[i] = grid[0][i] - grid[2][i];
			y23[i] = grid[1][i] - grid[2][i];
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			x12[i] = grid[i][0] - grid[i][1];
			x13[i] = grid[i][0] - grid[i][2];
			x23[i] = grid[i][1] - grid[i][2];
			y12[i] = grid[0][i] - grid[1][i];
			y13[i] = grid[0][i] - grid[2][i];
			y23[i] = grid[1][i] - grid[2][i];
		} {
			x12[i] = grid[i][0] - grid[i][1];
			x13[i] = grid[i][0] - grid[i][2];
			x23[i] = grid[i][1] - grid[i][2];
			y12[i] = grid[0][i] - grid[1][i];
			y13[i] = grid[0][i] - grid[2][i];
			y23[i] = grid[1][i] - grid[2][i];
		} x12[i] = grid[i][0] - grid[i][1] x12[i] x12 i grid[i][0] - grid[i][1] grid[i][0] grid[i] grid i 0 grid[i][1] grid[i] grid i 1 x13[i] = grid[i][0] - grid[i][2] x13[i] x13 i grid[i][0] - grid[i][2] grid[i][0] grid[i] grid i 0 grid[i][2] grid[i] grid i 2 x23[i] = grid[i][1] - grid[i][2] x23[i] x23 i grid[i][1] - grid[i][2] grid[i][1] grid[i] grid i 1 grid[i][2] grid[i] grid i 2 y12[i] = grid[0][i] - grid[1][i] y12[i] y12 i grid[0][i] - grid[1][i] grid[0][i] grid[0] grid 0 i grid[1][i] grid[1] grid 1 i y13[i] = grid[0][i] - grid[2][i] y13[i] y13 i grid[0][i] - grid[2][i] grid[0][i] grid[0] grid 0 i grid[2][i] grid[2] grid 2 i y23[i] = grid[1][i] - grid[2][i] y23[i] y23 i grid[1][i] - grid[2][i] grid[1][i] grid[1] grid 1 i grid[2][i] grid[2] grid 2 i boolean flag = true; flag true for (int i = 0; i < 2; i++) {
			for (int j = i + 1; j < 3; j++) {
				if (x12[i] != x12[j]) {
					flag = false;
					break;
				}
				if (x13[i] != x13[j]) {
					flag = false;
					break;
				}
				if (x23[i] != x23[j]) {
					flag = false;
					break;
				}
				if (y12[i] != y12[j]) {
					flag = false;
					break;
				}
				if (y13[i] != y13[j]) {
					flag = false;
					break;
				}
				if (y23[i] != y23[j]) {
					flag = false;
					break;
				}
			}
			if (!flag) {
				break;
			}
		} int i = 0; int i = 0; i 0 i < 2 i 2 i++ i++ i {
			for (int j = i + 1; j < 3; j++) {
				if (x12[i] != x12[j]) {
					flag = false;
					break;
				}
				if (x13[i] != x13[j]) {
					flag = false;
					break;
				}
				if (x23[i] != x23[j]) {
					flag = false;
					break;
				}
				if (y12[i] != y12[j]) {
					flag = false;
					break;
				}
				if (y13[i] != y13[j]) {
					flag = false;
					break;
				}
				if (y23[i] != y23[j]) {
					flag = false;
					break;
				}
			}
			if (!flag) {
				break;
			}
		} {
			for (int j = i + 1; j < 3; j++) {
				if (x12[i] != x12[j]) {
					flag = false;
					break;
				}
				if (x13[i] != x13[j]) {
					flag = false;
					break;
				}
				if (x23[i] != x23[j]) {
					flag = false;
					break;
				}
				if (y12[i] != y12[j]) {
					flag = false;
					break;
				}
				if (y13[i] != y13[j]) {
					flag = false;
					break;
				}
				if (y23[i] != y23[j]) {
					flag = false;
					break;
				}
			}
			if (!flag) {
				break;
			}
		} for (int j = i + 1; j < 3; j++) {
				if (x12[i] != x12[j]) {
					flag = false;
					break;
				}
				if (x13[i] != x13[j]) {
					flag = false;
					break;
				}
				if (x23[i] != x23[j]) {
					flag = false;
					break;
				}
				if (y12[i] != y12[j]) {
					flag = false;
					break;
				}
				if (y13[i] != y13[j]) {
					flag = false;
					break;
				}
				if (y23[i] != y23[j]) {
					flag = false;
					break;
				}
			} int j = i + 1; int j = i + 1; j i + 1 i 1 j < 3 j 3 j++ j++ j {
				if (x12[i] != x12[j]) {
					flag = false;
					break;
				}
				if (x13[i] != x13[j]) {
					flag = false;
					break;
				}
				if (x23[i] != x23[j]) {
					flag = false;
					break;
				}
				if (y12[i] != y12[j]) {
					flag = false;
					break;
				}
				if (y13[i] != y13[j]) {
					flag = false;
					break;
				}
				if (y23[i] != y23[j]) {
					flag = false;
					break;
				}
			} {
				if (x12[i] != x12[j]) {
					flag = false;
					break;
				}
				if (x13[i] != x13[j]) {
					flag = false;
					break;
				}
				if (x23[i] != x23[j]) {
					flag = false;
					break;
				}
				if (y12[i] != y12[j]) {
					flag = false;
					break;
				}
				if (y13[i] != y13[j]) {
					flag = false;
					break;
				}
				if (y23[i] != y23[j]) {
					flag = false;
					break;
				}
			} if (x12[i] != x12[j]) {
					flag = false;
					break;
				} x12[i] != x12[j] x12[i] x12 i x12[j] x12 j {
					flag = false;
					break;
				} flag = false flag false break; if (x13[i] != x13[j]) {
					flag = false;
					break;
				} x13[i] != x13[j] x13[i] x13 i x13[j] x13 j {
					flag = false;
					break;
				} flag = false flag false break; if (x23[i] != x23[j]) {
					flag = false;
					break;
				} x23[i] != x23[j] x23[i] x23 i x23[j] x23 j {
					flag = false;
					break;
				} flag = false flag false break; if (y12[i] != y12[j]) {
					flag = false;
					break;
				} y12[i] != y12[j] y12[i] y12 i y12[j] y12 j {
					flag = false;
					break;
				} flag = false flag false break; if (y13[i] != y13[j]) {
					flag = false;
					break;
				} y13[i] != y13[j] y13[i] y13 i y13[j] y13 j {
					flag = false;
					break;
				} flag = false flag false break; if (y23[i] != y23[j]) {
					flag = false;
					break;
				} y23[i] != y23[j] y23[i] y23 i y23[j] y23 j {
					flag = false;
					break;
				} flag = false flag false break; if (!flag) {
				break;
			} !flag flag {
				break;
			} break; if (flag) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		} flag {
			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[][] grid = new int[3][3];
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				grid[i][j] = sc.nextInt();
			}
		}
		int[] x12 = new int[3];
		int[] x13 = new int[3];
		int[] x23 = new int[3];
		int[] y12 = new int[3];
		int[] y13 = new int[3];
		int[] y23 = new int[3];
		
		for (int i = 0; i < 3; i++) {
			x12[i] = grid[i][0] - grid[i][1];
			x13[i] = grid[i][0] - grid[i][2];
			x23[i] = grid[i][1] - grid[i][2];
			y12[i] = grid[0][i] - grid[1][i];
			y13[i] = grid[0][i] - grid[2][i];
			y23[i] = grid[1][i] - grid[2][i];
		}
		boolean flag = true;
		for (int i = 0; i < 2; i++) {
			for (int j = i + 1; j < 3; j++) {
				if (x12[i] != x12[j]) {
					flag = false;
					break;
				}
				if (x13[i] != x13[j]) {
					flag = false;
					break;
				}
				if (x23[i] != x23[j]) {
					flag = false;
					break;
				}
				if (y12[i] != y12[j]) {
					flag = false;
					break;
				}
				if (y13[i] != y13[j]) {
					flag = false;
					break;
				}
				if (y23[i] != y23[j]) {
					flag = false;
					break;
				}
			}
			if (!flag) {
				break;
			}
		}
		if (flag) {
			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[][] grid = new int[3][3];
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				grid[i][j] = sc.nextInt();
			}
		}
		int[] x12 = new int[3];
		int[] x13 = new int[3];
		int[] x23 = new int[3];
		int[] y12 = new int[3];
		int[] y13 = new int[3];
		int[] y23 = new int[3];
		
		for (int i = 0; i < 3; i++) {
			x12[i] = grid[i][0] - grid[i][1];
			x13[i] = grid[i][0] - grid[i][2];
			x23[i] = grid[i][1] - grid[i][2];
			y12[i] = grid[0][i] - grid[1][i];
			y13[i] = grid[0][i] - grid[2][i];
			y23[i] = grid[1][i] - grid[2][i];
		}
		boolean flag = true;
		for (int i = 0; i < 2; i++) {
			for (int j = i + 1; j < 3; j++) {
				if (x12[i] != x12[j]) {
					flag = false;
					break;
				}
				if (x13[i] != x13[j]) {
					flag = false;
					break;
				}
				if (x23[i] != x23[j]) {
					flag = false;
					break;
				}
				if (y12[i] != y12[j]) {
					flag = false;
					break;
				}
				if (y13[i] != y13[j]) {
					flag = false;
					break;
				}
				if (y23[i] != y23[j]) {
					flag = false;
					break;
				}
			}
			if (!flag) {
				break;
			}
		}
		if (flag) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
} Main
import java.util.*;

public class Main {

	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int[][] grid = new int[3][3];
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				grid[i][j] = sc.nextInt();
			}
		}
		int[] x12 = new int[3];
		int[] x13 = new int[3];
		int[] x23 = new int[3];
		int[] y12 = new int[3];
		int[] y13 = new int[3];
		int[] y23 = new int[3];
		
		for (int i = 0; i < 3; i++) {
			x12[i] = grid[i][0] - grid[i][1];
			x13[i] = grid[i][0] - grid[i][2];
			x23[i] = grid[i][1] - grid[i][2];
			y12[i] = grid[0][i] - grid[1][i];
			y13[i] = grid[0][i] - grid[2][i];
			y23[i] = grid[1][i] - grid[2][i];
		}
		boolean flag = true;
		for (int i = 0; i < 2; i++) {
			for (int j = i + 1; j < 3; j++) {
				if (x12[i] != x12[j]) {
					flag = false;
					break;
				}
				if (x13[i] != x13[j]) {
					flag = false;
					break;
				}
				if (x23[i] != x23[j]) {
					flag = false;
					break;
				}
				if (y12[i] != y12[j]) {
					flag = false;
					break;
				}
				if (y13[i] != y13[j]) {
					flag = false;
					break;
				}
				if (y23[i] != y23[j]) {
					flag = false;
					break;
				}
			}
			if (!flag) {
				break;
			}
		}
		if (flag) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}
