import java.util.Scanner;

public class Main {


	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int adis1 = 0;
		int adis2 = 0;
		int bdis1 = 0;
		int bdis2 = 0;
		int[][] nums = new int[3][3];
		String answer = "Yes";

		// input
		for(int i = 0; i < 3; i++){
			for(int j = 0; j < 3; j++){
				nums[i][j] = scan.nextInt();
			}
		}

		// acheck
		adis1 = nums[1][0] - nums[0][0];
		adis2 = nums[2][0] - nums[1][0];
		for(int j = 1; j < 3; j++){
			if(nums[1][j] - nums[0][j] != adis1){
				answer = "No";
			}
			if(nums[2][j] - nums[1][j] != adis2){
				answer = "No";
			}
		}
		bdis1 = nums[0][1] - nums[0][0];
		bdis2 = nums[0][2] - nums[0][1];
		for(int i = 0; i < 3; i++){
			if(nums[i][1] - nums[i][0] != bdis1){
				answer = "No";
			}
			if(nums[i][2] - nums[i][1] != bdis2){
				answer = "No";
			}
		}

		System.out.println(answer);

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


	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int adis1 = 0;
		int adis2 = 0;
		int bdis1 = 0;
		int bdis2 = 0;
		int[][] nums = new int[3][3];
		String answer = "Yes";

		// input
		for(int i = 0; i < 3; i++){
			for(int j = 0; j < 3; j++){
				nums[i][j] = scan.nextInt();
			}
		}

		// acheck
		adis1 = nums[1][0] - nums[0][0];
		adis2 = nums[2][0] - nums[1][0];
		for(int j = 1; j < 3; j++){
			if(nums[1][j] - nums[0][j] != adis1){
				answer = "No";
			}
			if(nums[2][j] - nums[1][j] != adis2){
				answer = "No";
			}
		}
		bdis1 = nums[0][1] - nums[0][0];
		bdis2 = nums[0][2] - nums[0][1];
		for(int i = 0; i < 3; i++){
			if(nums[i][1] - nums[i][0] != bdis1){
				answer = "No";
			}
			if(nums[i][2] - nums[i][1] != bdis2){
				answer = "No";
			}
		}

		System.out.println(answer);

	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int adis1 = 0;
		int adis2 = 0;
		int bdis1 = 0;
		int bdis2 = 0;
		int[][] nums = new int[3][3];
		String answer = "Yes";

		// input
		for(int i = 0; i < 3; i++){
			for(int j = 0; j < 3; j++){
				nums[i][j] = scan.nextInt();
			}
		}

		// acheck
		adis1 = nums[1][0] - nums[0][0];
		adis2 = nums[2][0] - nums[1][0];
		for(int j = 1; j < 3; j++){
			if(nums[1][j] - nums[0][j] != adis1){
				answer = "No";
			}
			if(nums[2][j] - nums[1][j] != adis2){
				answer = "No";
			}
		}
		bdis1 = nums[0][1] - nums[0][0];
		bdis2 = nums[0][2] - nums[0][1];
		for(int i = 0; i < 3; i++){
			if(nums[i][1] - nums[i][0] != bdis1){
				answer = "No";
			}
			if(nums[i][2] - nums[i][1] != bdis2){
				answer = "No";
			}
		}

		System.out.println(answer);

	} main {
		Scanner scan = new Scanner(System.in);
		int adis1 = 0;
		int adis2 = 0;
		int bdis1 = 0;
		int bdis2 = 0;
		int[][] nums = new int[3][3];
		String answer = "Yes";

		// input
		for(int i = 0; i < 3; i++){
			for(int j = 0; j < 3; j++){
				nums[i][j] = scan.nextInt();
			}
		}

		// acheck
		adis1 = nums[1][0] - nums[0][0];
		adis2 = nums[2][0] - nums[1][0];
		for(int j = 1; j < 3; j++){
			if(nums[1][j] - nums[0][j] != adis1){
				answer = "No";
			}
			if(nums[2][j] - nums[1][j] != adis2){
				answer = "No";
			}
		}
		bdis1 = nums[0][1] - nums[0][0];
		bdis2 = nums[0][2] - nums[0][1];
		for(int i = 0; i < 3; i++){
			if(nums[i][1] - nums[i][0] != bdis1){
				answer = "No";
			}
			if(nums[i][2] - nums[i][1] != bdis2){
				answer = "No";
			}
		}

		System.out.println(answer);

	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int adis1 = 0; adis1 0 int adis2 = 0; adis2 0 int bdis1 = 0; bdis1 0 int bdis2 = 0; bdis2 0 int[][] nums = new int[3][3]; nums new int[3][3] 3 3 String answer = "Yes"; answer "Yes" for(int i = 0; i < 3; i++){
			for(int j = 0; j < 3; j++){
				nums[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++){
				nums[i][j] = scan.nextInt();
			}
		} {
			for(int j = 0; j < 3; j++){
				nums[i][j] = scan.nextInt();
			}
		} for(int j = 0; j < 3; j++){
				nums[i][j] = scan.nextInt();
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				nums[i][j] = scan.nextInt();
			} {
				nums[i][j] = scan.nextInt();
			} nums[i][j] = scan.nextInt() nums[i][j] nums[i] nums i j scan.nextInt() scan.nextInt scan adis1 = nums[1][0] - nums[0][0] adis1 nums[1][0] - nums[0][0] nums[1][0] nums[1] nums 1 0 nums[0][0] nums[0] nums 0 0 adis2 = nums[2][0] - nums[1][0] adis2 nums[2][0] - nums[1][0] nums[2][0] nums[2] nums 2 0 nums[1][0] nums[1] nums 1 0 for(int j = 1; j < 3; j++){
			if(nums[1][j] - nums[0][j] != adis1){
				answer = "No";
			}
			if(nums[2][j] - nums[1][j] != adis2){
				answer = "No";
			}
		} int j = 1; int j = 1; j 1 j < 3 j 3 j++ j++ j {
			if(nums[1][j] - nums[0][j] != adis1){
				answer = "No";
			}
			if(nums[2][j] - nums[1][j] != adis2){
				answer = "No";
			}
		} {
			if(nums[1][j] - nums[0][j] != adis1){
				answer = "No";
			}
			if(nums[2][j] - nums[1][j] != adis2){
				answer = "No";
			}
		} if(nums[1][j] - nums[0][j] != adis1){
				answer = "No";
			} nums[1][j] - nums[0][j] != adis1 nums[1][j] - nums[0][j] nums[1][j] nums[1] nums 1 j nums[0][j] nums[0] nums 0 j adis1 {
				answer = "No";
			} answer = "No" answer "No" if(nums[2][j] - nums[1][j] != adis2){
				answer = "No";
			} nums[2][j] - nums[1][j] != adis2 nums[2][j] - nums[1][j] nums[2][j] nums[2] nums 2 j nums[1][j] nums[1] nums 1 j adis2 {
				answer = "No";
			} answer = "No" answer "No" bdis1 = nums[0][1] - nums[0][0] bdis1 nums[0][1] - nums[0][0] nums[0][1] nums[0] nums 0 1 nums[0][0] nums[0] nums 0 0 bdis2 = nums[0][2] - nums[0][1] bdis2 nums[0][2] - nums[0][1] nums[0][2] nums[0] nums 0 2 nums[0][1] nums[0] nums 0 1 for(int i = 0; i < 3; i++){
			if(nums[i][1] - nums[i][0] != bdis1){
				answer = "No";
			}
			if(nums[i][2] - nums[i][1] != bdis2){
				answer = "No";
			}
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			if(nums[i][1] - nums[i][0] != bdis1){
				answer = "No";
			}
			if(nums[i][2] - nums[i][1] != bdis2){
				answer = "No";
			}
		} {
			if(nums[i][1] - nums[i][0] != bdis1){
				answer = "No";
			}
			if(nums[i][2] - nums[i][1] != bdis2){
				answer = "No";
			}
		} if(nums[i][1] - nums[i][0] != bdis1){
				answer = "No";
			} nums[i][1] - nums[i][0] != bdis1 nums[i][1] - nums[i][0] nums[i][1] nums[i] nums i 1 nums[i][0] nums[i] nums i 0 bdis1 {
				answer = "No";
			} answer = "No" answer "No" if(nums[i][2] - nums[i][1] != bdis2){
				answer = "No";
			} nums[i][2] - nums[i][1] != bdis2 nums[i][2] - nums[i][1] nums[i][2] nums[i] nums i 2 nums[i][1] nums[i] nums i 1 bdis2 {
				answer = "No";
			} answer = "No" answer "No" System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {


	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int adis1 = 0;
		int adis2 = 0;
		int bdis1 = 0;
		int bdis2 = 0;
		int[][] nums = new int[3][3];
		String answer = "Yes";

		// input
		for(int i = 0; i < 3; i++){
			for(int j = 0; j < 3; j++){
				nums[i][j] = scan.nextInt();
			}
		}

		// acheck
		adis1 = nums[1][0] - nums[0][0];
		adis2 = nums[2][0] - nums[1][0];
		for(int j = 1; j < 3; j++){
			if(nums[1][j] - nums[0][j] != adis1){
				answer = "No";
			}
			if(nums[2][j] - nums[1][j] != adis2){
				answer = "No";
			}
		}
		bdis1 = nums[0][1] - nums[0][0];
		bdis2 = nums[0][2] - nums[0][1];
		for(int i = 0; i < 3; i++){
			if(nums[i][1] - nums[i][0] != bdis1){
				answer = "No";
			}
			if(nums[i][2] - nums[i][1] != bdis2){
				answer = "No";
			}
		}

		System.out.println(answer);

	}
} public class Main {


	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int adis1 = 0;
		int adis2 = 0;
		int bdis1 = 0;
		int bdis2 = 0;
		int[][] nums = new int[3][3];
		String answer = "Yes";

		// input
		for(int i = 0; i < 3; i++){
			for(int j = 0; j < 3; j++){
				nums[i][j] = scan.nextInt();
			}
		}

		// acheck
		adis1 = nums[1][0] - nums[0][0];
		adis2 = nums[2][0] - nums[1][0];
		for(int j = 1; j < 3; j++){
			if(nums[1][j] - nums[0][j] != adis1){
				answer = "No";
			}
			if(nums[2][j] - nums[1][j] != adis2){
				answer = "No";
			}
		}
		bdis1 = nums[0][1] - nums[0][0];
		bdis2 = nums[0][2] - nums[0][1];
		for(int i = 0; i < 3; i++){
			if(nums[i][1] - nums[i][0] != bdis1){
				answer = "No";
			}
			if(nums[i][2] - nums[i][1] != bdis2){
				answer = "No";
			}
		}

		System.out.println(answer);

	}
} Main
import java.util.Scanner;

public class Main {


	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int adis1 = 0;
		int adis2 = 0;
		int bdis1 = 0;
		int bdis2 = 0;
		int[][] nums = new int[3][3];
		String answer = "Yes";

		// input
		for(int i = 0; i < 3; i++){
			for(int j = 0; j < 3; j++){
				nums[i][j] = scan.nextInt();
			}
		}

		// acheck
		adis1 = nums[1][0] - nums[0][0];
		adis2 = nums[2][0] - nums[1][0];
		for(int j = 1; j < 3; j++){
			if(nums[1][j] - nums[0][j] != adis1){
				answer = "No";
			}
			if(nums[2][j] - nums[1][j] != adis2){
				answer = "No";
			}
		}
		bdis1 = nums[0][1] - nums[0][0];
		bdis2 = nums[0][2] - nums[0][1];
		for(int i = 0; i < 3; i++){
			if(nums[i][1] - nums[i][0] != bdis1){
				answer = "No";
			}
			if(nums[i][2] - nums[i][1] != bdis2){
				answer = "No";
			}
		}

		System.out.println(answer);

	}
}

