import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = 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] = in.nextInt();
			}
		}
		int[] sum = new int[6];
		sum[0] = c[0][0] + c[1][1] + c[2][2];
		sum[1] = c[0][1] + c[1][2] + c[2][0];
		sum[2] = c[0][2] + c[1][0] + c[2][1];
		sum[3] = c[0][0] + c[1][2] + c[2][1];
		sum[4] = c[0][1] + c[1][0] + c[2][2];
		sum[5] = c[0][2] + c[1][1] + c[2][0];
		boolean takahashi = true;
		for(int i=1;i<6;i++) {
			if(sum[0]!=sum[i]) {
				takahashi = false;
				break;
			}
		}
		if(takahashi) System.out.println("Yes");
		else System.out.println("No");
		in.close();

	}

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

	public static void main(String[] args) {
		Scanner in = 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] = in.nextInt();
			}
		}
		int[] sum = new int[6];
		sum[0] = c[0][0] + c[1][1] + c[2][2];
		sum[1] = c[0][1] + c[1][2] + c[2][0];
		sum[2] = c[0][2] + c[1][0] + c[2][1];
		sum[3] = c[0][0] + c[1][2] + c[2][1];
		sum[4] = c[0][1] + c[1][0] + c[2][2];
		sum[5] = c[0][2] + c[1][1] + c[2][0];
		boolean takahashi = true;
		for(int i=1;i<6;i++) {
			if(sum[0]!=sum[i]) {
				takahashi = false;
				break;
			}
		}
		if(takahashi) System.out.println("Yes");
		else System.out.println("No");
		in.close();

	}

} Main public static void main(String[] args) {
		Scanner in = 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] = in.nextInt();
			}
		}
		int[] sum = new int[6];
		sum[0] = c[0][0] + c[1][1] + c[2][2];
		sum[1] = c[0][1] + c[1][2] + c[2][0];
		sum[2] = c[0][2] + c[1][0] + c[2][1];
		sum[3] = c[0][0] + c[1][2] + c[2][1];
		sum[4] = c[0][1] + c[1][0] + c[2][2];
		sum[5] = c[0][2] + c[1][1] + c[2][0];
		boolean takahashi = true;
		for(int i=1;i<6;i++) {
			if(sum[0]!=sum[i]) {
				takahashi = false;
				break;
			}
		}
		if(takahashi) System.out.println("Yes");
		else System.out.println("No");
		in.close();

	} main {
		Scanner in = 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] = in.nextInt();
			}
		}
		int[] sum = new int[6];
		sum[0] = c[0][0] + c[1][1] + c[2][2];
		sum[1] = c[0][1] + c[1][2] + c[2][0];
		sum[2] = c[0][2] + c[1][0] + c[2][1];
		sum[3] = c[0][0] + c[1][2] + c[2][1];
		sum[4] = c[0][1] + c[1][0] + c[2][2];
		sum[5] = c[0][2] + c[1][1] + c[2][0];
		boolean takahashi = true;
		for(int i=1;i<6;i++) {
			if(sum[0]!=sum[i]) {
				takahashi = false;
				break;
			}
		}
		if(takahashi) System.out.println("Yes");
		else System.out.println("No");
		in.close();

	} Scanner in = new Scanner(System.in); in 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] = in.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] = in.nextInt();
			}
		} {
			for(int j=0;j<3;j++) {
				c[i][j] = in.nextInt();
			}
		} for(int j=0;j<3;j++) {
				c[i][j] = in.nextInt();
			} int j=0; int j=0; j 0 j<3 j 3 j++ j++ j {
				c[i][j] = in.nextInt();
			} {
				c[i][j] = in.nextInt();
			} c[i][j] = in.nextInt() c[i][j] c[i] c i j in.nextInt() in.nextInt in int[] sum = new int[6]; sum new int[6] 6 sum[0] = c[0][0] + c[1][1] + c[2][2] sum[0] sum 0 c[0][0] + c[1][1] + c[2][2] c[0][0] + c[1][1] + c[2][2] c[0][0] c[0] c 0 0 c[1][1] c[1] c 1 1 c[2][2] c[2] c 2 2 sum[1] = c[0][1] + c[1][2] + c[2][0] sum[1] sum 1 c[0][1] + c[1][2] + c[2][0] c[0][1] + c[1][2] + c[2][0] c[0][1] c[0] c 0 1 c[1][2] c[1] c 1 2 c[2][0] c[2] c 2 0 sum[2] = c[0][2] + c[1][0] + c[2][1] sum[2] sum 2 c[0][2] + c[1][0] + c[2][1] c[0][2] + c[1][0] + c[2][1] c[0][2] c[0] c 0 2 c[1][0] c[1] c 1 0 c[2][1] c[2] c 2 1 sum[3] = c[0][0] + c[1][2] + c[2][1] sum[3] sum 3 c[0][0] + c[1][2] + c[2][1] c[0][0] + c[1][2] + c[2][1] c[0][0] c[0] c 0 0 c[1][2] c[1] c 1 2 c[2][1] c[2] c 2 1 sum[4] = c[0][1] + c[1][0] + c[2][2] sum[4] sum 4 c[0][1] + c[1][0] + c[2][2] c[0][1] + c[1][0] + c[2][2] c[0][1] c[0] c 0 1 c[1][0] c[1] c 1 0 c[2][2] c[2] c 2 2 sum[5] = c[0][2] + c[1][1] + c[2][0] sum[5] sum 5 c[0][2] + c[1][1] + c[2][0] c[0][2] + c[1][1] + c[2][0] c[0][2] c[0] c 0 2 c[1][1] c[1] c 1 1 c[2][0] c[2] c 2 0 boolean takahashi = true; takahashi true for(int i=1;i<6;i++) {
			if(sum[0]!=sum[i]) {
				takahashi = false;
				break;
			}
		} int i=1; int i=1; i 1 i<6 i 6 i++ i++ i {
			if(sum[0]!=sum[i]) {
				takahashi = false;
				break;
			}
		} {
			if(sum[0]!=sum[i]) {
				takahashi = false;
				break;
			}
		} if(sum[0]!=sum[i]) {
				takahashi = false;
				break;
			} sum[0]!=sum[i] sum[0] sum 0 sum[i] sum i {
				takahashi = false;
				break;
			} takahashi = false takahashi false break; if(takahashi) System.out.println("Yes");
		else System.out.println("No"); takahashi 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" in.close() in.close in String[] args args public class Main {

	public static void main(String[] args) {
		Scanner in = 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] = in.nextInt();
			}
		}
		int[] sum = new int[6];
		sum[0] = c[0][0] + c[1][1] + c[2][2];
		sum[1] = c[0][1] + c[1][2] + c[2][0];
		sum[2] = c[0][2] + c[1][0] + c[2][1];
		sum[3] = c[0][0] + c[1][2] + c[2][1];
		sum[4] = c[0][1] + c[1][0] + c[2][2];
		sum[5] = c[0][2] + c[1][1] + c[2][0];
		boolean takahashi = true;
		for(int i=1;i<6;i++) {
			if(sum[0]!=sum[i]) {
				takahashi = false;
				break;
			}
		}
		if(takahashi) System.out.println("Yes");
		else System.out.println("No");
		in.close();

	}

} public class Main {

	public static void main(String[] args) {
		Scanner in = 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] = in.nextInt();
			}
		}
		int[] sum = new int[6];
		sum[0] = c[0][0] + c[1][1] + c[2][2];
		sum[1] = c[0][1] + c[1][2] + c[2][0];
		sum[2] = c[0][2] + c[1][0] + c[2][1];
		sum[3] = c[0][0] + c[1][2] + c[2][1];
		sum[4] = c[0][1] + c[1][0] + c[2][2];
		sum[5] = c[0][2] + c[1][1] + c[2][0];
		boolean takahashi = true;
		for(int i=1;i<6;i++) {
			if(sum[0]!=sum[i]) {
				takahashi = false;
				break;
			}
		}
		if(takahashi) System.out.println("Yes");
		else System.out.println("No");
		in.close();

	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = 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] = in.nextInt();
			}
		}
		int[] sum = new int[6];
		sum[0] = c[0][0] + c[1][1] + c[2][2];
		sum[1] = c[0][1] + c[1][2] + c[2][0];
		sum[2] = c[0][2] + c[1][0] + c[2][1];
		sum[3] = c[0][0] + c[1][2] + c[2][1];
		sum[4] = c[0][1] + c[1][0] + c[2][2];
		sum[5] = c[0][2] + c[1][1] + c[2][0];
		boolean takahashi = true;
		for(int i=1;i<6;i++) {
			if(sum[0]!=sum[i]) {
				takahashi = false;
				break;
			}
		}
		if(takahashi) System.out.println("Yes");
		else System.out.println("No");
		in.close();

	}

}
