import java.util.Scanner;

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();
			}
		}
		boolean b = true;
		for(int i =0; i < 3; i++){
			int x = 0;
			int y = 0;
			for(int j =0;j<3;j++){
				int bX = grid[j][i] - grid[j][((i+1) % 3)];
				int bY = grid[i][j] - grid[((i+1) % 3)][j];
				if(j ==0){
					x = bX;
					y = bY;
				}else{
					b &= x == bX;
					b &= y == bY;
				}
				if(!b) break;
			}
			if(!b) break;
		}
		System.out.println(b ? "Yes" : "No");
	}
} import java.util.Scanner; Scanner 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();
			}
		}
		boolean b = true;
		for(int i =0; i < 3; i++){
			int x = 0;
			int y = 0;
			for(int j =0;j<3;j++){
				int bX = grid[j][i] - grid[j][((i+1) % 3)];
				int bY = grid[i][j] - grid[((i+1) % 3)][j];
				if(j ==0){
					x = bX;
					y = bY;
				}else{
					b &= x == bX;
					b &= y == bY;
				}
				if(!b) break;
			}
			if(!b) break;
		}
		System.out.println(b ? "Yes" : "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();
			}
		}
		boolean b = true;
		for(int i =0; i < 3; i++){
			int x = 0;
			int y = 0;
			for(int j =0;j<3;j++){
				int bX = grid[j][i] - grid[j][((i+1) % 3)];
				int bY = grid[i][j] - grid[((i+1) % 3)][j];
				if(j ==0){
					x = bX;
					y = bY;
				}else{
					b &= x == bX;
					b &= y == bY;
				}
				if(!b) break;
			}
			if(!b) break;
		}
		System.out.println(b ? "Yes" : "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();
			}
		}
		boolean b = true;
		for(int i =0; i < 3; i++){
			int x = 0;
			int y = 0;
			for(int j =0;j<3;j++){
				int bX = grid[j][i] - grid[j][((i+1) % 3)];
				int bY = grid[i][j] - grid[((i+1) % 3)][j];
				if(j ==0){
					x = bX;
					y = bY;
				}else{
					b &= x == bX;
					b &= y == bY;
				}
				if(!b) break;
			}
			if(!b) break;
		}
		System.out.println(b ? "Yes" : "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 boolean b = true; b true for(int i =0; i < 3; i++){
			int x = 0;
			int y = 0;
			for(int j =0;j<3;j++){
				int bX = grid[j][i] - grid[j][((i+1) % 3)];
				int bY = grid[i][j] - grid[((i+1) % 3)][j];
				if(j ==0){
					x = bX;
					y = bY;
				}else{
					b &= x == bX;
					b &= y == bY;
				}
				if(!b) break;
			}
			if(!b) break;
		} int i =0; int i =0; i 0 i < 3 i 3 i++ i++ i {
			int x = 0;
			int y = 0;
			for(int j =0;j<3;j++){
				int bX = grid[j][i] - grid[j][((i+1) % 3)];
				int bY = grid[i][j] - grid[((i+1) % 3)][j];
				if(j ==0){
					x = bX;
					y = bY;
				}else{
					b &= x == bX;
					b &= y == bY;
				}
				if(!b) break;
			}
			if(!b) break;
		} {
			int x = 0;
			int y = 0;
			for(int j =0;j<3;j++){
				int bX = grid[j][i] - grid[j][((i+1) % 3)];
				int bY = grid[i][j] - grid[((i+1) % 3)][j];
				if(j ==0){
					x = bX;
					y = bY;
				}else{
					b &= x == bX;
					b &= y == bY;
				}
				if(!b) break;
			}
			if(!b) break;
		} int x = 0; x 0 int y = 0; y 0 for(int j =0;j<3;j++){
				int bX = grid[j][i] - grid[j][((i+1) % 3)];
				int bY = grid[i][j] - grid[((i+1) % 3)][j];
				if(j ==0){
					x = bX;
					y = bY;
				}else{
					b &= x == bX;
					b &= y == bY;
				}
				if(!b) break;
			} int j =0; int j =0; j 0 j<3 j 3 j++ j++ j {
				int bX = grid[j][i] - grid[j][((i+1) % 3)];
				int bY = grid[i][j] - grid[((i+1) % 3)][j];
				if(j ==0){
					x = bX;
					y = bY;
				}else{
					b &= x == bX;
					b &= y == bY;
				}
				if(!b) break;
			} {
				int bX = grid[j][i] - grid[j][((i+1) % 3)];
				int bY = grid[i][j] - grid[((i+1) % 3)][j];
				if(j ==0){
					x = bX;
					y = bY;
				}else{
					b &= x == bX;
					b &= y == bY;
				}
				if(!b) break;
			} int bX = grid[j][i] - grid[j][((i+1) % 3)]; bX grid[j][i] - grid[j][((i+1) % 3)] grid[j][i] grid[j] grid j i grid[j][((i+1) % 3)] grid[j] grid j ((i+1) % 3) (i+1) i 1 3 int bY = grid[i][j] - grid[((i+1) % 3)][j]; bY grid[i][j] - grid[((i+1) % 3)][j] grid[i][j] grid[i] grid i j grid[((i+1) % 3)][j] grid[((i+1) % 3)] grid ((i+1) % 3) (i+1) i 1 3 j if(j ==0){
					x = bX;
					y = bY;
				}else{
					b &= x == bX;
					b &= y == bY;
				} j ==0 j 0 {
					x = bX;
					y = bY;
				} x = bX x bX y = bY y bY {
					b &= x == bX;
					b &= y == bY;
				} b &= x == bX b x == bX x bX b &= y == bY b y == bY y bY if(!b) break; !b b break; if(!b) break; !b b break; System.out.println(b ? "Yes" : "No") System.out.println System.out System System.out b ? "Yes" : "No" b "Yes" "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();
			}
		}
		boolean b = true;
		for(int i =0; i < 3; i++){
			int x = 0;
			int y = 0;
			for(int j =0;j<3;j++){
				int bX = grid[j][i] - grid[j][((i+1) % 3)];
				int bY = grid[i][j] - grid[((i+1) % 3)][j];
				if(j ==0){
					x = bX;
					y = bY;
				}else{
					b &= x == bX;
					b &= y == bY;
				}
				if(!b) break;
			}
			if(!b) break;
		}
		System.out.println(b ? "Yes" : "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();
			}
		}
		boolean b = true;
		for(int i =0; i < 3; i++){
			int x = 0;
			int y = 0;
			for(int j =0;j<3;j++){
				int bX = grid[j][i] - grid[j][((i+1) % 3)];
				int bY = grid[i][j] - grid[((i+1) % 3)][j];
				if(j ==0){
					x = bX;
					y = bY;
				}else{
					b &= x == bX;
					b &= y == bY;
				}
				if(!b) break;
			}
			if(!b) break;
		}
		System.out.println(b ? "Yes" : "No");
	}
} Main
import java.util.Scanner;

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();
			}
		}
		boolean b = true;
		for(int i =0; i < 3; i++){
			int x = 0;
			int y = 0;
			for(int j =0;j<3;j++){
				int bX = grid[j][i] - grid[j][((i+1) % 3)];
				int bY = grid[i][j] - grid[((i+1) % 3)][j];
				if(j ==0){
					x = bX;
					y = bY;
				}else{
					b &= x == bX;
					b &= y == bY;
				}
				if(!b) break;
			}
			if(!b) break;
		}
		System.out.println(b ? "Yes" : "No");
	}
}