import java.util.Scanner;


public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner s = 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] = s.nextInt();
			}
		}
		
		boolean can = true;
		can &= c[0][0] - c[1][0] == c[0][1] - c[1][1];
		can &= c[0][1] - c[1][1] == c[0][2] - c[1][2];
		can &= c[1][0] - c[2][0] == c[1][1] - c[2][1];
		can &= c[1][1] - c[2][1] == c[1][2] - c[2][2];/**/
		
		System.out.println(can ? "Yes" : "No");
	}

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

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner s = 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] = s.nextInt();
			}
		}
		
		boolean can = true;
		can &= c[0][0] - c[1][0] == c[0][1] - c[1][1];
		can &= c[0][1] - c[1][1] == c[0][2] - c[1][2];
		can &= c[1][0] - c[2][0] == c[1][1] - c[2][1];
		can &= c[1][1] - c[2][1] == c[1][2] - c[2][2];/**/
		
		System.out.println(can ? "Yes" : "No");
	}

} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner s = 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] = s.nextInt();
			}
		}
		
		boolean can = true;
		can &= c[0][0] - c[1][0] == c[0][1] - c[1][1];
		can &= c[0][1] - c[1][1] == c[0][2] - c[1][2];
		can &= c[1][0] - c[2][0] == c[1][1] - c[2][1];
		can &= c[1][1] - c[2][1] == c[1][2] - c[2][2];/**/
		
		System.out.println(can ? "Yes" : "No");
	} main {
		// TODO 自動生成されたメソッド・スタブ
		Scanner s = 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] = s.nextInt();
			}
		}
		
		boolean can = true;
		can &= c[0][0] - c[1][0] == c[0][1] - c[1][1];
		can &= c[0][1] - c[1][1] == c[0][2] - c[1][2];
		can &= c[1][0] - c[2][0] == c[1][1] - c[2][1];
		can &= c[1][1] - c[2][1] == c[1][2] - c[2][2];/**/
		
		System.out.println(can ? "Yes" : "No");
	} Scanner s = new Scanner(System.in); s 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] = s.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] = s.nextInt();
			}
		} {
			for(int j = 0;j < 3;j++){
				c[i][j] = s.nextInt();
			}
		} for(int j = 0;j < 3;j++){
				c[i][j] = s.nextInt();
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				c[i][j] = s.nextInt();
			} {
				c[i][j] = s.nextInt();
			} c[i][j] = s.nextInt() c[i][j] c[i] c i j s.nextInt() s.nextInt s boolean can = true; can true can &= c[0][0] - c[1][0] == c[0][1] - c[1][1] can c[0][0] - c[1][0] == c[0][1] - c[1][1] c[0][0] - c[1][0] c[0][0] c[0] c 0 0 c[1][0] c[1] c 1 0 c[0][1] - c[1][1] c[0][1] c[0] c 0 1 c[1][1] c[1] c 1 1 can &= c[0][1] - c[1][1] == c[0][2] - c[1][2] can c[0][1] - c[1][1] == c[0][2] - c[1][2] c[0][1] - c[1][1] c[0][1] c[0] c 0 1 c[1][1] c[1] c 1 1 c[0][2] - c[1][2] c[0][2] c[0] c 0 2 c[1][2] c[1] c 1 2 can &= c[1][0] - c[2][0] == c[1][1] - c[2][1] can c[1][0] - c[2][0] == c[1][1] - c[2][1] c[1][0] - c[2][0] c[1][0] c[1] c 1 0 c[2][0] c[2] c 2 0 c[1][1] - c[2][1] c[1][1] c[1] c 1 1 c[2][1] c[2] c 2 1 can &= c[1][1] - c[2][1] == c[1][2] - c[2][2] can c[1][1] - c[2][1] == c[1][2] - c[2][2] c[1][1] - c[2][1] c[1][1] c[1] c 1 1 c[2][1] c[2] c 2 1 c[1][2] - c[2][2] c[1][2] c[1] c 1 2 c[2][2] c[2] c 2 2 System.out.println(can ? "Yes" : "No") System.out.println System.out System System.out can ? "Yes" : "No" can "Yes" "No" String[] args args public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner s = 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] = s.nextInt();
			}
		}
		
		boolean can = true;
		can &= c[0][0] - c[1][0] == c[0][1] - c[1][1];
		can &= c[0][1] - c[1][1] == c[0][2] - c[1][2];
		can &= c[1][0] - c[2][0] == c[1][1] - c[2][1];
		can &= c[1][1] - c[2][1] == c[1][2] - c[2][2];/**/
		
		System.out.println(can ? "Yes" : "No");
	}

} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner s = 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] = s.nextInt();
			}
		}
		
		boolean can = true;
		can &= c[0][0] - c[1][0] == c[0][1] - c[1][1];
		can &= c[0][1] - c[1][1] == c[0][2] - c[1][2];
		can &= c[1][0] - c[2][0] == c[1][1] - c[2][1];
		can &= c[1][1] - c[2][1] == c[1][2] - c[2][2];/**/
		
		System.out.println(can ? "Yes" : "No");
	}

} Main
import java.util.Scanner;


public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner s = 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] = s.nextInt();
			}
		}
		
		boolean can = true;
		can &= c[0][0] - c[1][0] == c[0][1] - c[1][1];
		can &= c[0][1] - c[1][1] == c[0][2] - c[1][2];
		can &= c[1][0] - c[2][0] == c[1][1] - c[2][1];
		can &= c[1][1] - c[2][1] == c[1][2] - c[2][2];/**/
		
		System.out.println(can ? "Yes" : "No");
	}

}
