import java.util.Scanner;

public class Main { // https://atcoder.jp/contests/abc088/tasks/abc088_c
	static int[][] grid;
	static int[] left;
	static int[] top;
	
	static int size = 3;
	
	public static void main(String[] args) {
		Scanner x = new Scanner(System.in);
		grid = new int[size][size];
		left = new int[size];
		top = new int[size];
		for (int i = 0; i < size; i++) {
			for (int j = 0; j < size; j++) grid[i][j] = x.nextInt();
		}
		for (int i = 0; i < size; i++) {
			left[i] = grid[i][0];
			top[i] = grid[0][i];
		}
		
		boolean good = true;
		int curdiff, nowdiff;
		for (int i = 1; i < size; i++) {
			if (!good) break;
			curdiff = grid[i][0] - top[0];
			for (int j = 1; j < size; j++) {
				nowdiff = grid[i][j] - top[j];
				if (nowdiff != curdiff) {
					good = false;
					break;
				}
			}
			
		}
		
		for (int i = 1; i < size; i++) {
			if (!good) break;
			curdiff = grid[0][i] - left[0];
			for (int j = 1; j < size; j++) {
				nowdiff = grid[j][i] - left[j];
				if (nowdiff != curdiff) {
					good = false;
					break;
				}
			}
			
		}
		
	//	System.out.println(good);
		if (good) System.out.println("Yes");
		else System.out.println("No");
	}
} import java.util.Scanner; Scanner java.util public class Main { // https://atcoder.jp/contests/abc088/tasks/abc088_c
	static int[][] grid;
	static int[] left;
	static int[] top;
	
	static int size = 3;
	
	public static void main(String[] args) {
		Scanner x = new Scanner(System.in);
		grid = new int[size][size];
		left = new int[size];
		top = new int[size];
		for (int i = 0; i < size; i++) {
			for (int j = 0; j < size; j++) grid[i][j] = x.nextInt();
		}
		for (int i = 0; i < size; i++) {
			left[i] = grid[i][0];
			top[i] = grid[0][i];
		}
		
		boolean good = true;
		int curdiff, nowdiff;
		for (int i = 1; i < size; i++) {
			if (!good) break;
			curdiff = grid[i][0] - top[0];
			for (int j = 1; j < size; j++) {
				nowdiff = grid[i][j] - top[j];
				if (nowdiff != curdiff) {
					good = false;
					break;
				}
			}
			
		}
		
		for (int i = 1; i < size; i++) {
			if (!good) break;
			curdiff = grid[0][i] - left[0];
			for (int j = 1; j < size; j++) {
				nowdiff = grid[j][i] - left[j];
				if (nowdiff != curdiff) {
					good = false;
					break;
				}
			}
			
		}
		
	//	System.out.println(good);
		if (good) System.out.println("Yes");
		else System.out.println("No");
	}
} Main static int[][] grid; grid static int[] left; left static int[] top; top static int size = 3; size 3 public static void main(String[] args) {
		Scanner x = new Scanner(System.in);
		grid = new int[size][size];
		left = new int[size];
		top = new int[size];
		for (int i = 0; i < size; i++) {
			for (int j = 0; j < size; j++) grid[i][j] = x.nextInt();
		}
		for (int i = 0; i < size; i++) {
			left[i] = grid[i][0];
			top[i] = grid[0][i];
		}
		
		boolean good = true;
		int curdiff, nowdiff;
		for (int i = 1; i < size; i++) {
			if (!good) break;
			curdiff = grid[i][0] - top[0];
			for (int j = 1; j < size; j++) {
				nowdiff = grid[i][j] - top[j];
				if (nowdiff != curdiff) {
					good = false;
					break;
				}
			}
			
		}
		
		for (int i = 1; i < size; i++) {
			if (!good) break;
			curdiff = grid[0][i] - left[0];
			for (int j = 1; j < size; j++) {
				nowdiff = grid[j][i] - left[j];
				if (nowdiff != curdiff) {
					good = false;
					break;
				}
			}
			
		}
		
	//	System.out.println(good);
		if (good) System.out.println("Yes");
		else System.out.println("No");
	} main {
		Scanner x = new Scanner(System.in);
		grid = new int[size][size];
		left = new int[size];
		top = new int[size];
		for (int i = 0; i < size; i++) {
			for (int j = 0; j < size; j++) grid[i][j] = x.nextInt();
		}
		for (int i = 0; i < size; i++) {
			left[i] = grid[i][0];
			top[i] = grid[0][i];
		}
		
		boolean good = true;
		int curdiff, nowdiff;
		for (int i = 1; i < size; i++) {
			if (!good) break;
			curdiff = grid[i][0] - top[0];
			for (int j = 1; j < size; j++) {
				nowdiff = grid[i][j] - top[j];
				if (nowdiff != curdiff) {
					good = false;
					break;
				}
			}
			
		}
		
		for (int i = 1; i < size; i++) {
			if (!good) break;
			curdiff = grid[0][i] - left[0];
			for (int j = 1; j < size; j++) {
				nowdiff = grid[j][i] - left[j];
				if (nowdiff != curdiff) {
					good = false;
					break;
				}
			}
			
		}
		
	//	System.out.println(good);
		if (good) System.out.println("Yes");
		else System.out.println("No");
	} Scanner x = new Scanner(System.in); x new Scanner(System.in) grid = new int[size][size] grid new int[size][size] size size left = new int[size] left new int[size] size top = new int[size] top new int[size] size for (int i = 0; i < size; i++) {
			for (int j = 0; j < size; j++) grid[i][j] = x.nextInt();
		} int i = 0; int i = 0; i 0 i < size i size i++ i++ i {
			for (int j = 0; j < size; j++) grid[i][j] = x.nextInt();
		} {
			for (int j = 0; j < size; j++) grid[i][j] = x.nextInt();
		} for (int j = 0; j < size; j++) grid[i][j] = x.nextInt(); int j = 0; int j = 0; j 0 j < size j size j++ j++ j grid[i][j] = x.nextInt(); grid[i][j] = x.nextInt() grid[i][j] grid[i] grid i j x.nextInt() x.nextInt x for (int i = 0; i < size; i++) {
			left[i] = grid[i][0];
			top[i] = grid[0][i];
		} int i = 0; int i = 0; i 0 i < size i size i++ i++ i {
			left[i] = grid[i][0];
			top[i] = grid[0][i];
		} {
			left[i] = grid[i][0];
			top[i] = grid[0][i];
		} left[i] = grid[i][0] left[i] left i grid[i][0] grid[i] grid i 0 top[i] = grid[0][i] top[i] top i grid[0][i] grid[0] grid 0 i boolean good = true; good true int curdiff curdiff nowdiff; nowdiff for (int i = 1; i < size; i++) {
			if (!good) break;
			curdiff = grid[i][0] - top[0];
			for (int j = 1; j < size; j++) {
				nowdiff = grid[i][j] - top[j];
				if (nowdiff != curdiff) {
					good = false;
					break;
				}
			}
			
		} int i = 1; int i = 1; i 1 i < size i size i++ i++ i {
			if (!good) break;
			curdiff = grid[i][0] - top[0];
			for (int j = 1; j < size; j++) {
				nowdiff = grid[i][j] - top[j];
				if (nowdiff != curdiff) {
					good = false;
					break;
				}
			}
			
		} {
			if (!good) break;
			curdiff = grid[i][0] - top[0];
			for (int j = 1; j < size; j++) {
				nowdiff = grid[i][j] - top[j];
				if (nowdiff != curdiff) {
					good = false;
					break;
				}
			}
			
		} if (!good) break; !good good break; curdiff = grid[i][0] - top[0] curdiff grid[i][0] - top[0] grid[i][0] grid[i] grid i 0 top[0] top 0 for (int j = 1; j < size; j++) {
				nowdiff = grid[i][j] - top[j];
				if (nowdiff != curdiff) {
					good = false;
					break;
				}
			} int j = 1; int j = 1; j 1 j < size j size j++ j++ j {
				nowdiff = grid[i][j] - top[j];
				if (nowdiff != curdiff) {
					good = false;
					break;
				}
			} {
				nowdiff = grid[i][j] - top[j];
				if (nowdiff != curdiff) {
					good = false;
					break;
				}
			} nowdiff = grid[i][j] - top[j] nowdiff grid[i][j] - top[j] grid[i][j] grid[i] grid i j top[j] top j if (nowdiff != curdiff) {
					good = false;
					break;
				} nowdiff != curdiff nowdiff curdiff {
					good = false;
					break;
				} good = false good false break; for (int i = 1; i < size; i++) {
			if (!good) break;
			curdiff = grid[0][i] - left[0];
			for (int j = 1; j < size; j++) {
				nowdiff = grid[j][i] - left[j];
				if (nowdiff != curdiff) {
					good = false;
					break;
				}
			}
			
		} int i = 1; int i = 1; i 1 i < size i size i++ i++ i {
			if (!good) break;
			curdiff = grid[0][i] - left[0];
			for (int j = 1; j < size; j++) {
				nowdiff = grid[j][i] - left[j];
				if (nowdiff != curdiff) {
					good = false;
					break;
				}
			}
			
		} {
			if (!good) break;
			curdiff = grid[0][i] - left[0];
			for (int j = 1; j < size; j++) {
				nowdiff = grid[j][i] - left[j];
				if (nowdiff != curdiff) {
					good = false;
					break;
				}
			}
			
		} if (!good) break; !good good break; curdiff = grid[0][i] - left[0] curdiff grid[0][i] - left[0] grid[0][i] grid[0] grid 0 i left[0] left 0 for (int j = 1; j < size; j++) {
				nowdiff = grid[j][i] - left[j];
				if (nowdiff != curdiff) {
					good = false;
					break;
				}
			} int j = 1; int j = 1; j 1 j < size j size j++ j++ j {
				nowdiff = grid[j][i] - left[j];
				if (nowdiff != curdiff) {
					good = false;
					break;
				}
			} {
				nowdiff = grid[j][i] - left[j];
				if (nowdiff != curdiff) {
					good = false;
					break;
				}
			} nowdiff = grid[j][i] - left[j] nowdiff grid[j][i] - left[j] grid[j][i] grid[j] grid j i left[j] left j if (nowdiff != curdiff) {
					good = false;
					break;
				} nowdiff != curdiff nowdiff curdiff {
					good = false;
					break;
				} good = false good false break; if (good) System.out.println("Yes");
		else System.out.println("No"); good System.out.println("Yes") System.out.println System.out System System.out "Yes" System.out.println("No") System.out.println System.out System System.out "No" String[] args args public class Main { // https://atcoder.jp/contests/abc088/tasks/abc088_c
	static int[][] grid;
	static int[] left;
	static int[] top;
	
	static int size = 3;
	
	public static void main(String[] args) {
		Scanner x = new Scanner(System.in);
		grid = new int[size][size];
		left = new int[size];
		top = new int[size];
		for (int i = 0; i < size; i++) {
			for (int j = 0; j < size; j++) grid[i][j] = x.nextInt();
		}
		for (int i = 0; i < size; i++) {
			left[i] = grid[i][0];
			top[i] = grid[0][i];
		}
		
		boolean good = true;
		int curdiff, nowdiff;
		for (int i = 1; i < size; i++) {
			if (!good) break;
			curdiff = grid[i][0] - top[0];
			for (int j = 1; j < size; j++) {
				nowdiff = grid[i][j] - top[j];
				if (nowdiff != curdiff) {
					good = false;
					break;
				}
			}
			
		}
		
		for (int i = 1; i < size; i++) {
			if (!good) break;
			curdiff = grid[0][i] - left[0];
			for (int j = 1; j < size; j++) {
				nowdiff = grid[j][i] - left[j];
				if (nowdiff != curdiff) {
					good = false;
					break;
				}
			}
			
		}
		
	//	System.out.println(good);
		if (good) System.out.println("Yes");
		else System.out.println("No");
	}
} public class Main { // https://atcoder.jp/contests/abc088/tasks/abc088_c
	static int[][] grid;
	static int[] left;
	static int[] top;
	
	static int size = 3;
	
	public static void main(String[] args) {
		Scanner x = new Scanner(System.in);
		grid = new int[size][size];
		left = new int[size];
		top = new int[size];
		for (int i = 0; i < size; i++) {
			for (int j = 0; j < size; j++) grid[i][j] = x.nextInt();
		}
		for (int i = 0; i < size; i++) {
			left[i] = grid[i][0];
			top[i] = grid[0][i];
		}
		
		boolean good = true;
		int curdiff, nowdiff;
		for (int i = 1; i < size; i++) {
			if (!good) break;
			curdiff = grid[i][0] - top[0];
			for (int j = 1; j < size; j++) {
				nowdiff = grid[i][j] - top[j];
				if (nowdiff != curdiff) {
					good = false;
					break;
				}
			}
			
		}
		
		for (int i = 1; i < size; i++) {
			if (!good) break;
			curdiff = grid[0][i] - left[0];
			for (int j = 1; j < size; j++) {
				nowdiff = grid[j][i] - left[j];
				if (nowdiff != curdiff) {
					good = false;
					break;
				}
			}
			
		}
		
	//	System.out.println(good);
		if (good) System.out.println("Yes");
		else System.out.println("No");
	}
} Main
import java.util.Scanner;

public class Main { // https://atcoder.jp/contests/abc088/tasks/abc088_c
	static int[][] grid;
	static int[] left;
	static int[] top;
	
	static int size = 3;
	
	public static void main(String[] args) {
		Scanner x = new Scanner(System.in);
		grid = new int[size][size];
		left = new int[size];
		top = new int[size];
		for (int i = 0; i < size; i++) {
			for (int j = 0; j < size; j++) grid[i][j] = x.nextInt();
		}
		for (int i = 0; i < size; i++) {
			left[i] = grid[i][0];
			top[i] = grid[0][i];
		}
		
		boolean good = true;
		int curdiff, nowdiff;
		for (int i = 1; i < size; i++) {
			if (!good) break;
			curdiff = grid[i][0] - top[0];
			for (int j = 1; j < size; j++) {
				nowdiff = grid[i][j] - top[j];
				if (nowdiff != curdiff) {
					good = false;
					break;
				}
			}
			
		}
		
		for (int i = 1; i < size; i++) {
			if (!good) break;
			curdiff = grid[0][i] - left[0];
			for (int j = 1; j < size; j++) {
				nowdiff = grid[j][i] - left[j];
				if (nowdiff != curdiff) {
					good = false;
					break;
				}
			}
			
		}
		
	//	System.out.println(good);
		if (good) System.out.println("Yes");
		else System.out.println("No");
	}
}
