import java.util.Scanner;

class Main{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int[][] youso=new int[3][3];
		for(int i=0; i<3; i++) {
			for(int j=0; j<3; j++) {
				youso[i][j]=sc.nextInt();
			}
		}

		int[] tmp=new int[3];
		tmp[0]=youso[1][0]-youso[0][0];
		tmp[1]=youso[2][0]-youso[1][0];
		tmp[2]=youso[2][0]-youso[0][0];
		int aa[][]= {{1,0},{2,1},{2,0}};
		boolean[] vali=new boolean[3];
		for(int i=0; i<3; i++) {
			vali[i]=true;
		}
		for(int i=0; i<3; i++) {
			for(int j=0; j<3; j++) {
				if(youso[aa[i][0]][j]-youso[aa[i][1]][j]!=tmp[i]) {
					System.out.println("No");
					System.exit(0);
				}
			}
		}
		System.out.println("Yes");
	}
} import java.util.Scanner; Scanner java.util class Main{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int[][] youso=new int[3][3];
		for(int i=0; i<3; i++) {
			for(int j=0; j<3; j++) {
				youso[i][j]=sc.nextInt();
			}
		}

		int[] tmp=new int[3];
		tmp[0]=youso[1][0]-youso[0][0];
		tmp[1]=youso[2][0]-youso[1][0];
		tmp[2]=youso[2][0]-youso[0][0];
		int aa[][]= {{1,0},{2,1},{2,0}};
		boolean[] vali=new boolean[3];
		for(int i=0; i<3; i++) {
			vali[i]=true;
		}
		for(int i=0; i<3; i++) {
			for(int j=0; j<3; j++) {
				if(youso[aa[i][0]][j]-youso[aa[i][1]][j]!=tmp[i]) {
					System.out.println("No");
					System.exit(0);
				}
			}
		}
		System.out.println("Yes");
	}
} Main public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int[][] youso=new int[3][3];
		for(int i=0; i<3; i++) {
			for(int j=0; j<3; j++) {
				youso[i][j]=sc.nextInt();
			}
		}

		int[] tmp=new int[3];
		tmp[0]=youso[1][0]-youso[0][0];
		tmp[1]=youso[2][0]-youso[1][0];
		tmp[2]=youso[2][0]-youso[0][0];
		int aa[][]= {{1,0},{2,1},{2,0}};
		boolean[] vali=new boolean[3];
		for(int i=0; i<3; i++) {
			vali[i]=true;
		}
		for(int i=0; i<3; i++) {
			for(int j=0; j<3; j++) {
				if(youso[aa[i][0]][j]-youso[aa[i][1]][j]!=tmp[i]) {
					System.out.println("No");
					System.exit(0);
				}
			}
		}
		System.out.println("Yes");
	} main {
		Scanner sc=new Scanner(System.in);
		int[][] youso=new int[3][3];
		for(int i=0; i<3; i++) {
			for(int j=0; j<3; j++) {
				youso[i][j]=sc.nextInt();
			}
		}

		int[] tmp=new int[3];
		tmp[0]=youso[1][0]-youso[0][0];
		tmp[1]=youso[2][0]-youso[1][0];
		tmp[2]=youso[2][0]-youso[0][0];
		int aa[][]= {{1,0},{2,1},{2,0}};
		boolean[] vali=new boolean[3];
		for(int i=0; i<3; i++) {
			vali[i]=true;
		}
		for(int i=0; i<3; i++) {
			for(int j=0; j<3; j++) {
				if(youso[aa[i][0]][j]-youso[aa[i][1]][j]!=tmp[i]) {
					System.out.println("No");
					System.exit(0);
				}
			}
		}
		System.out.println("Yes");
	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int[][] youso=new int[3][3]; youso new int[3][3] 3 3 for(int i=0; i<3; i++) {
			for(int j=0; j<3; j++) {
				youso[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++) {
				youso[i][j]=sc.nextInt();
			}
		} {
			for(int j=0; j<3; j++) {
				youso[i][j]=sc.nextInt();
			}
		} for(int j=0; j<3; j++) {
				youso[i][j]=sc.nextInt();
			} int j=0; int j=0; j 0 j<3 j 3 j++ j++ j {
				youso[i][j]=sc.nextInt();
			} {
				youso[i][j]=sc.nextInt();
			} youso[i][j]=sc.nextInt() youso[i][j] youso[i] youso i j sc.nextInt() sc.nextInt sc int[] tmp=new int[3]; tmp new int[3] 3 tmp[0]=youso[1][0]-youso[0][0] tmp[0] tmp 0 youso[1][0]-youso[0][0] youso[1][0] youso[1] youso 1 0 youso[0][0] youso[0] youso 0 0 tmp[1]=youso[2][0]-youso[1][0] tmp[1] tmp 1 youso[2][0]-youso[1][0] youso[2][0] youso[2] youso 2 0 youso[1][0] youso[1] youso 1 0 tmp[2]=youso[2][0]-youso[0][0] tmp[2] tmp 2 youso[2][0]-youso[0][0] youso[2][0] youso[2] youso 2 0 youso[0][0] youso[0] youso 0 0 int aa[][]= {{1,0},{2,1},{2,0}}; aa {{1,0},{2,1},{2,0}} {1,0} 1 0 {2,1} 2 1 {2,0} 2 0 boolean[] vali=new boolean[3]; vali new boolean[3] 3 for(int i=0; i<3; i++) {
			vali[i]=true;
		} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
			vali[i]=true;
		} {
			vali[i]=true;
		} vali[i]=true vali[i] vali i true for(int i=0; i<3; i++) {
			for(int j=0; j<3; j++) {
				if(youso[aa[i][0]][j]-youso[aa[i][1]][j]!=tmp[i]) {
					System.out.println("No");
					System.exit(0);
				}
			}
		} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
			for(int j=0; j<3; j++) {
				if(youso[aa[i][0]][j]-youso[aa[i][1]][j]!=tmp[i]) {
					System.out.println("No");
					System.exit(0);
				}
			}
		} {
			for(int j=0; j<3; j++) {
				if(youso[aa[i][0]][j]-youso[aa[i][1]][j]!=tmp[i]) {
					System.out.println("No");
					System.exit(0);
				}
			}
		} for(int j=0; j<3; j++) {
				if(youso[aa[i][0]][j]-youso[aa[i][1]][j]!=tmp[i]) {
					System.out.println("No");
					System.exit(0);
				}
			} int j=0; int j=0; j 0 j<3 j 3 j++ j++ j {
				if(youso[aa[i][0]][j]-youso[aa[i][1]][j]!=tmp[i]) {
					System.out.println("No");
					System.exit(0);
				}
			} {
				if(youso[aa[i][0]][j]-youso[aa[i][1]][j]!=tmp[i]) {
					System.out.println("No");
					System.exit(0);
				}
			} if(youso[aa[i][0]][j]-youso[aa[i][1]][j]!=tmp[i]) {
					System.out.println("No");
					System.exit(0);
				} youso[aa[i][0]][j]-youso[aa[i][1]][j]!=tmp[i] youso[aa[i][0]][j]-youso[aa[i][1]][j] youso[aa[i][0]][j] youso[aa[i][0]] youso aa[i][0] aa[i] aa i 0 j youso[aa[i][1]][j] youso[aa[i][1]] youso aa[i][1] aa[i] aa i 1 j tmp[i] tmp i {
					System.out.println("No");
					System.exit(0);
				} System.out.println("No") System.out.println System.out System System.out "No" System.exit(0) System.exit System 0 System.out.println("Yes") System.out.println System.out System System.out "Yes" String[] args args
import java.util.Scanner;

class Main{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int[][] youso=new int[3][3];
		for(int i=0; i<3; i++) {
			for(int j=0; j<3; j++) {
				youso[i][j]=sc.nextInt();
			}
		}

		int[] tmp=new int[3];
		tmp[0]=youso[1][0]-youso[0][0];
		tmp[1]=youso[2][0]-youso[1][0];
		tmp[2]=youso[2][0]-youso[0][0];
		int aa[][]= {{1,0},{2,1},{2,0}};
		boolean[] vali=new boolean[3];
		for(int i=0; i<3; i++) {
			vali[i]=true;
		}
		for(int i=0; i<3; i++) {
			for(int j=0; j<3; j++) {
				if(youso[aa[i][0]][j]-youso[aa[i][1]][j]!=tmp[i]) {
					System.out.println("No");
					System.exit(0);
				}
			}
		}
		System.out.println("Yes");
	}
}