import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int c[][]=new int[3][3];
		for(int i=0;i<3;i++) {
			for(int j=0;j<3;j++) {
				c[i][j]=scan.nextInt();
			}
		}
		scan.close();
		int check=0;
		for(int i=0;i<2;i++) {
			for(int j=0;j<2;j++) {
				if(c[j][i]-c[j][i+1] !=  c[j+1][i]-c[j+1][i+1]) {
					check=1;break;
				}
			}
			if(check==1)break;
		}

		for(int i=0;i<2;i++) {
			for(int j=0;j<2;j++) {
				if(c[i][j]-c[i+1][j] !=  c[i][j+1]-c[i+1][j+1]) {
					check=1;break;
				}
			}
			if(check==1)break;
		}

		System.out.println((check==0)?"Yes":"No");
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int c[][]=new int[3][3];
		for(int i=0;i<3;i++) {
			for(int j=0;j<3;j++) {
				c[i][j]=scan.nextInt();
			}
		}
		scan.close();
		int check=0;
		for(int i=0;i<2;i++) {
			for(int j=0;j<2;j++) {
				if(c[j][i]-c[j][i+1] !=  c[j+1][i]-c[j+1][i+1]) {
					check=1;break;
				}
			}
			if(check==1)break;
		}

		for(int i=0;i<2;i++) {
			for(int j=0;j<2;j++) {
				if(c[i][j]-c[i+1][j] !=  c[i][j+1]-c[i+1][j+1]) {
					check=1;break;
				}
			}
			if(check==1)break;
		}

		System.out.println((check==0)?"Yes":"No");
	}

} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int c[][]=new int[3][3];
		for(int i=0;i<3;i++) {
			for(int j=0;j<3;j++) {
				c[i][j]=scan.nextInt();
			}
		}
		scan.close();
		int check=0;
		for(int i=0;i<2;i++) {
			for(int j=0;j<2;j++) {
				if(c[j][i]-c[j][i+1] !=  c[j+1][i]-c[j+1][i+1]) {
					check=1;break;
				}
			}
			if(check==1)break;
		}

		for(int i=0;i<2;i++) {
			for(int j=0;j<2;j++) {
				if(c[i][j]-c[i+1][j] !=  c[i][j+1]-c[i+1][j+1]) {
					check=1;break;
				}
			}
			if(check==1)break;
		}

		System.out.println((check==0)?"Yes":"No");
	} main {
		Scanner scan = new Scanner(System.in);
		int c[][]=new int[3][3];
		for(int i=0;i<3;i++) {
			for(int j=0;j<3;j++) {
				c[i][j]=scan.nextInt();
			}
		}
		scan.close();
		int check=0;
		for(int i=0;i<2;i++) {
			for(int j=0;j<2;j++) {
				if(c[j][i]-c[j][i+1] !=  c[j+1][i]-c[j+1][i+1]) {
					check=1;break;
				}
			}
			if(check==1)break;
		}

		for(int i=0;i<2;i++) {
			for(int j=0;j<2;j++) {
				if(c[i][j]-c[i+1][j] !=  c[i][j+1]-c[i+1][j+1]) {
					check=1;break;
				}
			}
			if(check==1)break;
		}

		System.out.println((check==0)?"Yes":"No");
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int c[][]=new int[3][3]; c new int[3][3] 3 3 for(int i=0;i<3;i++) {
			for(int j=0;j<3;j++) {
				c[i][j]=scan.nextInt();
			}
		} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
			for(int j=0;j<3;j++) {
				c[i][j]=scan.nextInt();
			}
		} {
			for(int j=0;j<3;j++) {
				c[i][j]=scan.nextInt();
			}
		} for(int j=0;j<3;j++) {
				c[i][j]=scan.nextInt();
			} int j=0; int j=0; j 0 j<3 j 3 j++ j++ j {
				c[i][j]=scan.nextInt();
			} {
				c[i][j]=scan.nextInt();
			} c[i][j]=scan.nextInt() c[i][j] c[i] c i j scan.nextInt() scan.nextInt scan scan.close() scan.close scan int check=0; check 0 for(int i=0;i<2;i++) {
			for(int j=0;j<2;j++) {
				if(c[j][i]-c[j][i+1] !=  c[j+1][i]-c[j+1][i+1]) {
					check=1;break;
				}
			}
			if(check==1)break;
		} int i=0; int i=0; i 0 i<2 i 2 i++ i++ i {
			for(int j=0;j<2;j++) {
				if(c[j][i]-c[j][i+1] !=  c[j+1][i]-c[j+1][i+1]) {
					check=1;break;
				}
			}
			if(check==1)break;
		} {
			for(int j=0;j<2;j++) {
				if(c[j][i]-c[j][i+1] !=  c[j+1][i]-c[j+1][i+1]) {
					check=1;break;
				}
			}
			if(check==1)break;
		} for(int j=0;j<2;j++) {
				if(c[j][i]-c[j][i+1] !=  c[j+1][i]-c[j+1][i+1]) {
					check=1;break;
				}
			} int j=0; int j=0; j 0 j<2 j 2 j++ j++ j {
				if(c[j][i]-c[j][i+1] !=  c[j+1][i]-c[j+1][i+1]) {
					check=1;break;
				}
			} {
				if(c[j][i]-c[j][i+1] !=  c[j+1][i]-c[j+1][i+1]) {
					check=1;break;
				}
			} if(c[j][i]-c[j][i+1] !=  c[j+1][i]-c[j+1][i+1]) {
					check=1;break;
				} c[j][i]-c[j][i+1] !=  c[j+1][i]-c[j+1][i+1] c[j][i]-c[j][i+1] c[j][i] c[j] c j i c[j][i+1] c[j] c j i+1 i 1 c[j+1][i]-c[j+1][i+1] c[j+1][i] c[j+1] c j+1 j 1 i c[j+1][i+1] c[j+1] c j+1 j 1 i+1 i 1 {
					check=1;break;
				} check=1 check 1 break; if(check==1)break; check==1 check 1 break; for(int i=0;i<2;i++) {
			for(int j=0;j<2;j++) {
				if(c[i][j]-c[i+1][j] !=  c[i][j+1]-c[i+1][j+1]) {
					check=1;break;
				}
			}
			if(check==1)break;
		} int i=0; int i=0; i 0 i<2 i 2 i++ i++ i {
			for(int j=0;j<2;j++) {
				if(c[i][j]-c[i+1][j] !=  c[i][j+1]-c[i+1][j+1]) {
					check=1;break;
				}
			}
			if(check==1)break;
		} {
			for(int j=0;j<2;j++) {
				if(c[i][j]-c[i+1][j] !=  c[i][j+1]-c[i+1][j+1]) {
					check=1;break;
				}
			}
			if(check==1)break;
		} for(int j=0;j<2;j++) {
				if(c[i][j]-c[i+1][j] !=  c[i][j+1]-c[i+1][j+1]) {
					check=1;break;
				}
			} int j=0; int j=0; j 0 j<2 j 2 j++ j++ j {
				if(c[i][j]-c[i+1][j] !=  c[i][j+1]-c[i+1][j+1]) {
					check=1;break;
				}
			} {
				if(c[i][j]-c[i+1][j] !=  c[i][j+1]-c[i+1][j+1]) {
					check=1;break;
				}
			} if(c[i][j]-c[i+1][j] !=  c[i][j+1]-c[i+1][j+1]) {
					check=1;break;
				} c[i][j]-c[i+1][j] !=  c[i][j+1]-c[i+1][j+1] c[i][j]-c[i+1][j] c[i][j] c[i] c i j c[i+1][j] c[i+1] c i+1 i 1 j c[i][j+1]-c[i+1][j+1] c[i][j+1] c[i] c i j+1 j 1 c[i+1][j+1] c[i+1] c i+1 i 1 j+1 j 1 {
					check=1;break;
				} check=1 check 1 break; if(check==1)break; check==1 check 1 break; System.out.println((check==0)?"Yes":"No") System.out.println System.out System System.out (check==0)?"Yes":"No" (check==0) check 0 "Yes" "No" String[] args args public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int c[][]=new int[3][3];
		for(int i=0;i<3;i++) {
			for(int j=0;j<3;j++) {
				c[i][j]=scan.nextInt();
			}
		}
		scan.close();
		int check=0;
		for(int i=0;i<2;i++) {
			for(int j=0;j<2;j++) {
				if(c[j][i]-c[j][i+1] !=  c[j+1][i]-c[j+1][i+1]) {
					check=1;break;
				}
			}
			if(check==1)break;
		}

		for(int i=0;i<2;i++) {
			for(int j=0;j<2;j++) {
				if(c[i][j]-c[i+1][j] !=  c[i][j+1]-c[i+1][j+1]) {
					check=1;break;
				}
			}
			if(check==1)break;
		}

		System.out.println((check==0)?"Yes":"No");
	}

} public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int c[][]=new int[3][3];
		for(int i=0;i<3;i++) {
			for(int j=0;j<3;j++) {
				c[i][j]=scan.nextInt();
			}
		}
		scan.close();
		int check=0;
		for(int i=0;i<2;i++) {
			for(int j=0;j<2;j++) {
				if(c[j][i]-c[j][i+1] !=  c[j+1][i]-c[j+1][i+1]) {
					check=1;break;
				}
			}
			if(check==1)break;
		}

		for(int i=0;i<2;i++) {
			for(int j=0;j<2;j++) {
				if(c[i][j]-c[i+1][j] !=  c[i][j+1]-c[i+1][j+1]) {
					check=1;break;
				}
			}
			if(check==1)break;
		}

		System.out.println((check==0)?"Yes":"No");
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int c[][]=new int[3][3];
		for(int i=0;i<3;i++) {
			for(int j=0;j<3;j++) {
				c[i][j]=scan.nextInt();
			}
		}
		scan.close();
		int check=0;
		for(int i=0;i<2;i++) {
			for(int j=0;j<2;j++) {
				if(c[j][i]-c[j][i+1] !=  c[j+1][i]-c[j+1][i+1]) {
					check=1;break;
				}
			}
			if(check==1)break;
		}

		for(int i=0;i<2;i++) {
			for(int j=0;j<2;j++) {
				if(c[i][j]-c[i+1][j] !=  c[i][j+1]-c[i+1][j+1]) {
					check=1;break;
				}
			}
			if(check==1)break;
		}

		System.out.println((check==0)?"Yes":"No");
	}

}