import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int[][] nums = new int[4][4];
		for (int rIdx = 1; rIdx <= 3; rIdx++) {
			String[] inputs = scanner.nextLine().split(" ");
			for (int cIdx = 1; cIdx <=3; cIdx++) nums[rIdx][cIdx] = Integer.parseInt(inputs[cIdx - 1]);
		}

		boolean isRightInfo = true;
		for (int idx = 2; idx <= 3; idx++) {
			int diff = nums[idx][1] - nums[1][1];
			if (diff != nums[idx][2] - nums[1][2] || diff != nums[idx][3] - nums[1][3]) isRightInfo = false;

			diff = nums[1][idx] - nums[1][1];
			if (diff != nums[2][idx] - nums[2][1] || diff != nums[3][idx] - nums[3][1]) isRightInfo = false;
		}

		if (isRightInfo) System.out.println("Yes");
		else System.out.println("No");
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int[][] nums = new int[4][4];
		for (int rIdx = 1; rIdx <= 3; rIdx++) {
			String[] inputs = scanner.nextLine().split(" ");
			for (int cIdx = 1; cIdx <=3; cIdx++) nums[rIdx][cIdx] = Integer.parseInt(inputs[cIdx - 1]);
		}

		boolean isRightInfo = true;
		for (int idx = 2; idx <= 3; idx++) {
			int diff = nums[idx][1] - nums[1][1];
			if (diff != nums[idx][2] - nums[1][2] || diff != nums[idx][3] - nums[1][3]) isRightInfo = false;

			diff = nums[1][idx] - nums[1][1];
			if (diff != nums[2][idx] - nums[2][1] || diff != nums[3][idx] - nums[3][1]) isRightInfo = false;
		}

		if (isRightInfo) System.out.println("Yes");
		else System.out.println("No");
	}
} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int[][] nums = new int[4][4];
		for (int rIdx = 1; rIdx <= 3; rIdx++) {
			String[] inputs = scanner.nextLine().split(" ");
			for (int cIdx = 1; cIdx <=3; cIdx++) nums[rIdx][cIdx] = Integer.parseInt(inputs[cIdx - 1]);
		}

		boolean isRightInfo = true;
		for (int idx = 2; idx <= 3; idx++) {
			int diff = nums[idx][1] - nums[1][1];
			if (diff != nums[idx][2] - nums[1][2] || diff != nums[idx][3] - nums[1][3]) isRightInfo = false;

			diff = nums[1][idx] - nums[1][1];
			if (diff != nums[2][idx] - nums[2][1] || diff != nums[3][idx] - nums[3][1]) isRightInfo = false;
		}

		if (isRightInfo) System.out.println("Yes");
		else System.out.println("No");
	} main {
		Scanner scanner = new Scanner(System.in);
		int[][] nums = new int[4][4];
		for (int rIdx = 1; rIdx <= 3; rIdx++) {
			String[] inputs = scanner.nextLine().split(" ");
			for (int cIdx = 1; cIdx <=3; cIdx++) nums[rIdx][cIdx] = Integer.parseInt(inputs[cIdx - 1]);
		}

		boolean isRightInfo = true;
		for (int idx = 2; idx <= 3; idx++) {
			int diff = nums[idx][1] - nums[1][1];
			if (diff != nums[idx][2] - nums[1][2] || diff != nums[idx][3] - nums[1][3]) isRightInfo = false;

			diff = nums[1][idx] - nums[1][1];
			if (diff != nums[2][idx] - nums[2][1] || diff != nums[3][idx] - nums[3][1]) isRightInfo = false;
		}

		if (isRightInfo) System.out.println("Yes");
		else System.out.println("No");
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int[][] nums = new int[4][4]; nums new int[4][4] 4 4 for (int rIdx = 1; rIdx <= 3; rIdx++) {
			String[] inputs = scanner.nextLine().split(" ");
			for (int cIdx = 1; cIdx <=3; cIdx++) nums[rIdx][cIdx] = Integer.parseInt(inputs[cIdx - 1]);
		} int rIdx = 1; int rIdx = 1; rIdx 1 rIdx <= 3 rIdx 3 rIdx++ rIdx++ rIdx {
			String[] inputs = scanner.nextLine().split(" ");
			for (int cIdx = 1; cIdx <=3; cIdx++) nums[rIdx][cIdx] = Integer.parseInt(inputs[cIdx - 1]);
		} {
			String[] inputs = scanner.nextLine().split(" ");
			for (int cIdx = 1; cIdx <=3; cIdx++) nums[rIdx][cIdx] = Integer.parseInt(inputs[cIdx - 1]);
		} String[] inputs = scanner.nextLine().split(" "); inputs scanner.nextLine().split(" ") scanner.nextLine().split scanner.nextLine() scanner.nextLine scanner " " for (int cIdx = 1; cIdx <=3; cIdx++) nums[rIdx][cIdx] = Integer.parseInt(inputs[cIdx - 1]); int cIdx = 1; int cIdx = 1; cIdx 1 cIdx <=3 cIdx 3 cIdx++ cIdx++ cIdx nums[rIdx][cIdx] = Integer.parseInt(inputs[cIdx - 1]); nums[rIdx][cIdx] = Integer.parseInt(inputs[cIdx - 1]) nums[rIdx][cIdx] nums[rIdx] nums rIdx cIdx Integer.parseInt(inputs[cIdx - 1]) Integer.parseInt Integer inputs[cIdx - 1] inputs cIdx - 1 cIdx 1 boolean isRightInfo = true; isRightInfo true for (int idx = 2; idx <= 3; idx++) {
			int diff = nums[idx][1] - nums[1][1];
			if (diff != nums[idx][2] - nums[1][2] || diff != nums[idx][3] - nums[1][3]) isRightInfo = false;

			diff = nums[1][idx] - nums[1][1];
			if (diff != nums[2][idx] - nums[2][1] || diff != nums[3][idx] - nums[3][1]) isRightInfo = false;
		} int idx = 2; int idx = 2; idx 2 idx <= 3 idx 3 idx++ idx++ idx {
			int diff = nums[idx][1] - nums[1][1];
			if (diff != nums[idx][2] - nums[1][2] || diff != nums[idx][3] - nums[1][3]) isRightInfo = false;

			diff = nums[1][idx] - nums[1][1];
			if (diff != nums[2][idx] - nums[2][1] || diff != nums[3][idx] - nums[3][1]) isRightInfo = false;
		} {
			int diff = nums[idx][1] - nums[1][1];
			if (diff != nums[idx][2] - nums[1][2] || diff != nums[idx][3] - nums[1][3]) isRightInfo = false;

			diff = nums[1][idx] - nums[1][1];
			if (diff != nums[2][idx] - nums[2][1] || diff != nums[3][idx] - nums[3][1]) isRightInfo = false;
		} int diff = nums[idx][1] - nums[1][1]; diff nums[idx][1] - nums[1][1] nums[idx][1] nums[idx] nums idx 1 nums[1][1] nums[1] nums 1 1 if (diff != nums[idx][2] - nums[1][2] || diff != nums[idx][3] - nums[1][3]) isRightInfo = false; diff != nums[idx][2] - nums[1][2] || diff != nums[idx][3] - nums[1][3] diff != nums[idx][2] - nums[1][2] diff nums[idx][2] - nums[1][2] nums[idx][2] nums[idx] nums idx 2 nums[1][2] nums[1] nums 1 2 diff != nums[idx][3] - nums[1][3] diff nums[idx][3] - nums[1][3] nums[idx][3] nums[idx] nums idx 3 nums[1][3] nums[1] nums 1 3 isRightInfo = false isRightInfo false diff = nums[1][idx] - nums[1][1] diff nums[1][idx] - nums[1][1] nums[1][idx] nums[1] nums 1 idx nums[1][1] nums[1] nums 1 1 if (diff != nums[2][idx] - nums[2][1] || diff != nums[3][idx] - nums[3][1]) isRightInfo = false; diff != nums[2][idx] - nums[2][1] || diff != nums[3][idx] - nums[3][1] diff != nums[2][idx] - nums[2][1] diff nums[2][idx] - nums[2][1] nums[2][idx] nums[2] nums 2 idx nums[2][1] nums[2] nums 2 1 diff != nums[3][idx] - nums[3][1] diff nums[3][idx] - nums[3][1] nums[3][idx] nums[3] nums 3 idx nums[3][1] nums[3] nums 3 1 isRightInfo = false isRightInfo false if (isRightInfo) System.out.println("Yes");
		else System.out.println("No"); isRightInfo 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" String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int[][] nums = new int[4][4];
		for (int rIdx = 1; rIdx <= 3; rIdx++) {
			String[] inputs = scanner.nextLine().split(" ");
			for (int cIdx = 1; cIdx <=3; cIdx++) nums[rIdx][cIdx] = Integer.parseInt(inputs[cIdx - 1]);
		}

		boolean isRightInfo = true;
		for (int idx = 2; idx <= 3; idx++) {
			int diff = nums[idx][1] - nums[1][1];
			if (diff != nums[idx][2] - nums[1][2] || diff != nums[idx][3] - nums[1][3]) isRightInfo = false;

			diff = nums[1][idx] - nums[1][1];
			if (diff != nums[2][idx] - nums[2][1] || diff != nums[3][idx] - nums[3][1]) isRightInfo = false;
		}

		if (isRightInfo) System.out.println("Yes");
		else System.out.println("No");
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int[][] nums = new int[4][4];
		for (int rIdx = 1; rIdx <= 3; rIdx++) {
			String[] inputs = scanner.nextLine().split(" ");
			for (int cIdx = 1; cIdx <=3; cIdx++) nums[rIdx][cIdx] = Integer.parseInt(inputs[cIdx - 1]);
		}

		boolean isRightInfo = true;
		for (int idx = 2; idx <= 3; idx++) {
			int diff = nums[idx][1] - nums[1][1];
			if (diff != nums[idx][2] - nums[1][2] || diff != nums[idx][3] - nums[1][3]) isRightInfo = false;

			diff = nums[1][idx] - nums[1][1];
			if (diff != nums[2][idx] - nums[2][1] || diff != nums[3][idx] - nums[3][1]) isRightInfo = false;
		}

		if (isRightInfo) System.out.println("Yes");
		else System.out.println("No");
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int[][] nums = new int[4][4];
		for (int rIdx = 1; rIdx <= 3; rIdx++) {
			String[] inputs = scanner.nextLine().split(" ");
			for (int cIdx = 1; cIdx <=3; cIdx++) nums[rIdx][cIdx] = Integer.parseInt(inputs[cIdx - 1]);
		}

		boolean isRightInfo = true;
		for (int idx = 2; idx <= 3; idx++) {
			int diff = nums[idx][1] - nums[1][1];
			if (diff != nums[idx][2] - nums[1][2] || diff != nums[idx][3] - nums[1][3]) isRightInfo = false;

			diff = nums[1][idx] - nums[1][1];
			if (diff != nums[2][idx] - nums[2][1] || diff != nums[3][idx] - nums[3][1]) isRightInfo = false;
		}

		if (isRightInfo) System.out.println("Yes");
		else System.out.println("No");
	}
}
