import java.util.Scanner;
public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[][]data = new int[3][3];
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				data[i][j] = sc.nextInt();
			}
		}
		int a1 = 0;
		int b1 = data[0][0];
		int b2 = data[1][0];
		int b3 = data[2][0];
		int a2 = data[0][1]-b1;
		int a3 = data[0][2]-b1;
		if(data[0][0]==a1+b1 && data[0][1]==a2+b1 && data[0][2]==a3+b1 && data[1][0]==a1+b2 && data[1][1]==a2+b2 && data[1][2]==a3+b2 && data[2][0]==a1+b3 && data[2][1]==a2+b3 && data[2][2]==a3+b3) {
			System.out.println("Yes");
		}else System.out.println("No");
		sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[][]data = new int[3][3];
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				data[i][j] = sc.nextInt();
			}
		}
		int a1 = 0;
		int b1 = data[0][0];
		int b2 = data[1][0];
		int b3 = data[2][0];
		int a2 = data[0][1]-b1;
		int a3 = data[0][2]-b1;
		if(data[0][0]==a1+b1 && data[0][1]==a2+b1 && data[0][2]==a3+b1 && data[1][0]==a1+b2 && data[1][1]==a2+b2 && data[1][2]==a3+b2 && data[2][0]==a1+b3 && data[2][1]==a2+b3 && data[2][2]==a3+b3) {
			System.out.println("Yes");
		}else System.out.println("No");
		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[][]data = new int[3][3];
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				data[i][j] = sc.nextInt();
			}
		}
		int a1 = 0;
		int b1 = data[0][0];
		int b2 = data[1][0];
		int b3 = data[2][0];
		int a2 = data[0][1]-b1;
		int a3 = data[0][2]-b1;
		if(data[0][0]==a1+b1 && data[0][1]==a2+b1 && data[0][2]==a3+b1 && data[1][0]==a1+b2 && data[1][1]==a2+b2 && data[1][2]==a3+b2 && data[2][0]==a1+b3 && data[2][1]==a2+b3 && data[2][2]==a3+b3) {
			System.out.println("Yes");
		}else System.out.println("No");
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int[][]data = new int[3][3];
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				data[i][j] = sc.nextInt();
			}
		}
		int a1 = 0;
		int b1 = data[0][0];
		int b2 = data[1][0];
		int b3 = data[2][0];
		int a2 = data[0][1]-b1;
		int a3 = data[0][2]-b1;
		if(data[0][0]==a1+b1 && data[0][1]==a2+b1 && data[0][2]==a3+b1 && data[1][0]==a1+b2 && data[1][1]==a2+b2 && data[1][2]==a3+b2 && data[2][0]==a1+b3 && data[2][1]==a2+b3 && data[2][2]==a3+b3) {
			System.out.println("Yes");
		}else System.out.println("No");
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[][]data = new int[3][3]; data new int[3][3] 3 3 for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				data[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++) {
				data[i][j] = sc.nextInt();
			}
		} {
			for(int j = 0; j < 3; j++) {
				data[i][j] = sc.nextInt();
			}
		} for(int j = 0; j < 3; j++) {
				data[i][j] = sc.nextInt();
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				data[i][j] = sc.nextInt();
			} {
				data[i][j] = sc.nextInt();
			} data[i][j] = sc.nextInt() data[i][j] data[i] data i j sc.nextInt() sc.nextInt sc int a1 = 0; a1 0 int b1 = data[0][0]; b1 data[0][0] data[0] data 0 0 int b2 = data[1][0]; b2 data[1][0] data[1] data 1 0 int b3 = data[2][0]; b3 data[2][0] data[2] data 2 0 int a2 = data[0][1]-b1; a2 data[0][1]-b1 data[0][1] data[0] data 0 1 b1 int a3 = data[0][2]-b1; a3 data[0][2]-b1 data[0][2] data[0] data 0 2 b1 if(data[0][0]==a1+b1 && data[0][1]==a2+b1 && data[0][2]==a3+b1 && data[1][0]==a1+b2 && data[1][1]==a2+b2 && data[1][2]==a3+b2 && data[2][0]==a1+b3 && data[2][1]==a2+b3 && data[2][2]==a3+b3) {
			System.out.println("Yes");
		}else System.out.println("No"); data[0][0]==a1+b1 && data[0][1]==a2+b1 && data[0][2]==a3+b1 && data[1][0]==a1+b2 && data[1][1]==a2+b2 && data[1][2]==a3+b2 && data[2][0]==a1+b3 && data[2][1]==a2+b3 && data[2][2]==a3+b3 data[2][1]==a2+b3 data[2][0]==a1+b3 data[1][2]==a3+b2 data[1][1]==a2+b2 data[1][0]==a1+b2 data[0][2]==a3+b1 data[0][0]==a1+b1 && data[0][1]==a2+b1 && data[0][2]==a3+b1 && data[1][0]==a1+b2 && data[1][1]==a2+b2 && data[1][2]==a3+b2 && data[2][0]==a1+b3 && data[2][1]==a2+b3 && data[2][2]==a3+b3 data[0][0]==a1+b1 data[0][0] data[0] data 0 0 a1+b1 a1 b1 data[0][1]==a2+b1 data[0][1] data[0] data 0 1 a2+b1 a2 b1 data[0][2]==a3+b1 data[0][2] data[0] data 0 2 a3+b1 a3 b1 data[1][0]==a1+b2 data[1][0] data[1] data 1 0 a1+b2 a1 b2 data[1][1]==a2+b2 data[1][1] data[1] data 1 1 a2+b2 a2 b2 data[1][2]==a3+b2 data[1][2] data[1] data 1 2 a3+b2 a3 b2 data[2][0]==a1+b3 data[2][0] data[2] data 2 0 a1+b3 a1 b3 data[2][1]==a2+b3 data[2][1] data[2] data 2 1 a2+b3 a2 b3 data[2][2]==a3+b3 data[2][2] data[2] data 2 2 a3+b3 a3 b3 {
			System.out.println("Yes");
		} 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" sc.close() sc.close sc String[] args args public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[][]data = new int[3][3];
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				data[i][j] = sc.nextInt();
			}
		}
		int a1 = 0;
		int b1 = data[0][0];
		int b2 = data[1][0];
		int b3 = data[2][0];
		int a2 = data[0][1]-b1;
		int a3 = data[0][2]-b1;
		if(data[0][0]==a1+b1 && data[0][1]==a2+b1 && data[0][2]==a3+b1 && data[1][0]==a1+b2 && data[1][1]==a2+b2 && data[1][2]==a3+b2 && data[2][0]==a1+b3 && data[2][1]==a2+b3 && data[2][2]==a3+b3) {
			System.out.println("Yes");
		}else System.out.println("No");
		sc.close();
	}
} public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[][]data = new int[3][3];
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				data[i][j] = sc.nextInt();
			}
		}
		int a1 = 0;
		int b1 = data[0][0];
		int b2 = data[1][0];
		int b3 = data[2][0];
		int a2 = data[0][1]-b1;
		int a3 = data[0][2]-b1;
		if(data[0][0]==a1+b1 && data[0][1]==a2+b1 && data[0][2]==a3+b1 && data[1][0]==a1+b2 && data[1][1]==a2+b2 && data[1][2]==a3+b2 && data[2][0]==a1+b3 && data[2][1]==a2+b3 && data[2][2]==a3+b3) {
			System.out.println("Yes");
		}else System.out.println("No");
		sc.close();
	}
} Main
import java.util.Scanner;
public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[][]data = new int[3][3];
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				data[i][j] = sc.nextInt();
			}
		}
		int a1 = 0;
		int b1 = data[0][0];
		int b2 = data[1][0];
		int b3 = data[2][0];
		int a2 = data[0][1]-b1;
		int a3 = data[0][2]-b1;
		if(data[0][0]==a1+b1 && data[0][1]==a2+b1 && data[0][2]==a3+b1 && data[1][0]==a1+b2 && data[1][1]==a2+b2 && data[1][2]==a3+b2 && data[2][0]==a1+b3 && data[2][1]==a2+b3 && data[2][2]==a3+b3) {
			System.out.println("Yes");
		}else System.out.println("No");
		sc.close();
	}
}