

import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);

		int a[][] = new int[3][3];
		boolean flag = true;
		for (int j = 0; j < 3; j++) {
			for (int i = 0; i < 3; i++) {
				a[i][j] = in.nextInt();
			}
		}

		int sa1 = a[0][1] - a[0][0];
		int sa2 = a[1][1] - a[1][0];
		int sa3 = a[2][1] - a[2][0];

		int sa21 = a[0][2] - a[0][0];
		int sa22 = a[1][2] - a[1][0];
		int sa23 = a[2][2] - a[2][0];

		int sa31 = a[0][2] - a[0][1];
		int sa32 = a[1][2] - a[1][1];
		int sa33 = a[2][2] - a[2][1];

		if (sa1 == sa2 && sa1 == sa3) {
			if (sa21 == sa22 && sa21 == sa23) {
				if (sa31 == sa32 && sa31 == sa33) {
					flag = true;
				} else {
					flag = false;
				}
			} else {
				flag = false;
			}
		} else {
			flag = false;
		}
		
		if(flag) {
			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 in = new Scanner(System.in);

		int a[][] = new int[3][3];
		boolean flag = true;
		for (int j = 0; j < 3; j++) {
			for (int i = 0; i < 3; i++) {
				a[i][j] = in.nextInt();
			}
		}

		int sa1 = a[0][1] - a[0][0];
		int sa2 = a[1][1] - a[1][0];
		int sa3 = a[2][1] - a[2][0];

		int sa21 = a[0][2] - a[0][0];
		int sa22 = a[1][2] - a[1][0];
		int sa23 = a[2][2] - a[2][0];

		int sa31 = a[0][2] - a[0][1];
		int sa32 = a[1][2] - a[1][1];
		int sa33 = a[2][2] - a[2][1];

		if (sa1 == sa2 && sa1 == sa3) {
			if (sa21 == sa22 && sa21 == sa23) {
				if (sa31 == sa32 && sa31 == sa33) {
					flag = true;
				} else {
					flag = false;
				}
			} else {
				flag = false;
			}
		} else {
			flag = false;
		}
		
		if(flag) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
			
		}

	}
} Main public static void main(String[] args) {
		Scanner in = new Scanner(System.in);

		int a[][] = new int[3][3];
		boolean flag = true;
		for (int j = 0; j < 3; j++) {
			for (int i = 0; i < 3; i++) {
				a[i][j] = in.nextInt();
			}
		}

		int sa1 = a[0][1] - a[0][0];
		int sa2 = a[1][1] - a[1][0];
		int sa3 = a[2][1] - a[2][0];

		int sa21 = a[0][2] - a[0][0];
		int sa22 = a[1][2] - a[1][0];
		int sa23 = a[2][2] - a[2][0];

		int sa31 = a[0][2] - a[0][1];
		int sa32 = a[1][2] - a[1][1];
		int sa33 = a[2][2] - a[2][1];

		if (sa1 == sa2 && sa1 == sa3) {
			if (sa21 == sa22 && sa21 == sa23) {
				if (sa31 == sa32 && sa31 == sa33) {
					flag = true;
				} else {
					flag = false;
				}
			} else {
				flag = false;
			}
		} else {
			flag = false;
		}
		
		if(flag) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
			
		}

	} main {
		Scanner in = new Scanner(System.in);

		int a[][] = new int[3][3];
		boolean flag = true;
		for (int j = 0; j < 3; j++) {
			for (int i = 0; i < 3; i++) {
				a[i][j] = in.nextInt();
			}
		}

		int sa1 = a[0][1] - a[0][0];
		int sa2 = a[1][1] - a[1][0];
		int sa3 = a[2][1] - a[2][0];

		int sa21 = a[0][2] - a[0][0];
		int sa22 = a[1][2] - a[1][0];
		int sa23 = a[2][2] - a[2][0];

		int sa31 = a[0][2] - a[0][1];
		int sa32 = a[1][2] - a[1][1];
		int sa33 = a[2][2] - a[2][1];

		if (sa1 == sa2 && sa1 == sa3) {
			if (sa21 == sa22 && sa21 == sa23) {
				if (sa31 == sa32 && sa31 == sa33) {
					flag = true;
				} else {
					flag = false;
				}
			} else {
				flag = false;
			}
		} else {
			flag = false;
		}
		
		if(flag) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
			
		}

	} Scanner in = new Scanner(System.in); in new Scanner(System.in) int a[][] = new int[3][3]; a new int[3][3] 3 3 boolean flag = true; flag true for (int j = 0; j < 3; j++) {
			for (int i = 0; i < 3; i++) {
				a[i][j] = in.nextInt();
			}
		} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
			for (int i = 0; i < 3; i++) {
				a[i][j] = in.nextInt();
			}
		} {
			for (int i = 0; i < 3; i++) {
				a[i][j] = in.nextInt();
			}
		} for (int i = 0; i < 3; i++) {
				a[i][j] = in.nextInt();
			} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
				a[i][j] = in.nextInt();
			} {
				a[i][j] = in.nextInt();
			} a[i][j] = in.nextInt() a[i][j] a[i] a i j in.nextInt() in.nextInt in int sa1 = a[0][1] - a[0][0]; sa1 a[0][1] - a[0][0] a[0][1] a[0] a 0 1 a[0][0] a[0] a 0 0 int sa2 = a[1][1] - a[1][0]; sa2 a[1][1] - a[1][0] a[1][1] a[1] a 1 1 a[1][0] a[1] a 1 0 int sa3 = a[2][1] - a[2][0]; sa3 a[2][1] - a[2][0] a[2][1] a[2] a 2 1 a[2][0] a[2] a 2 0 int sa21 = a[0][2] - a[0][0]; sa21 a[0][2] - a[0][0] a[0][2] a[0] a 0 2 a[0][0] a[0] a 0 0 int sa22 = a[1][2] - a[1][0]; sa22 a[1][2] - a[1][0] a[1][2] a[1] a 1 2 a[1][0] a[1] a 1 0 int sa23 = a[2][2] - a[2][0]; sa23 a[2][2] - a[2][0] a[2][2] a[2] a 2 2 a[2][0] a[2] a 2 0 int sa31 = a[0][2] - a[0][1]; sa31 a[0][2] - a[0][1] a[0][2] a[0] a 0 2 a[0][1] a[0] a 0 1 int sa32 = a[1][2] - a[1][1]; sa32 a[1][2] - a[1][1] a[1][2] a[1] a 1 2 a[1][1] a[1] a 1 1 int sa33 = a[2][2] - a[2][1]; sa33 a[2][2] - a[2][1] a[2][2] a[2] a 2 2 a[2][1] a[2] a 2 1 if (sa1 == sa2 && sa1 == sa3) {
			if (sa21 == sa22 && sa21 == sa23) {
				if (sa31 == sa32 && sa31 == sa33) {
					flag = true;
				} else {
					flag = false;
				}
			} else {
				flag = false;
			}
		} else {
			flag = false;
		} sa1 == sa2 && sa1 == sa3 sa1 == sa2 sa1 sa2 sa1 == sa3 sa1 sa3 {
			if (sa21 == sa22 && sa21 == sa23) {
				if (sa31 == sa32 && sa31 == sa33) {
					flag = true;
				} else {
					flag = false;
				}
			} else {
				flag = false;
			}
		} if (sa21 == sa22 && sa21 == sa23) {
				if (sa31 == sa32 && sa31 == sa33) {
					flag = true;
				} else {
					flag = false;
				}
			} else {
				flag = false;
			} sa21 == sa22 && sa21 == sa23 sa21 == sa22 sa21 sa22 sa21 == sa23 sa21 sa23 {
				if (sa31 == sa32 && sa31 == sa33) {
					flag = true;
				} else {
					flag = false;
				}
			} if (sa31 == sa32 && sa31 == sa33) {
					flag = true;
				} else {
					flag = false;
				} sa31 == sa32 && sa31 == sa33 sa31 == sa32 sa31 sa32 sa31 == sa33 sa31 sa33 {
					flag = true;
				} flag = true flag true {
					flag = false;
				} flag = false flag false {
				flag = false;
			} flag = false flag false {
			flag = false;
		} flag = false flag false if(flag) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
			
		} flag {
			System.out.println("Yes");
		} System.out.println("Yes") System.out.println System.out System System.out "Yes" {
			System.out.println("No");
			
		} 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 in = new Scanner(System.in);

		int a[][] = new int[3][3];
		boolean flag = true;
		for (int j = 0; j < 3; j++) {
			for (int i = 0; i < 3; i++) {
				a[i][j] = in.nextInt();
			}
		}

		int sa1 = a[0][1] - a[0][0];
		int sa2 = a[1][1] - a[1][0];
		int sa3 = a[2][1] - a[2][0];

		int sa21 = a[0][2] - a[0][0];
		int sa22 = a[1][2] - a[1][0];
		int sa23 = a[2][2] - a[2][0];

		int sa31 = a[0][2] - a[0][1];
		int sa32 = a[1][2] - a[1][1];
		int sa33 = a[2][2] - a[2][1];

		if (sa1 == sa2 && sa1 == sa3) {
			if (sa21 == sa22 && sa21 == sa23) {
				if (sa31 == sa32 && sa31 == sa33) {
					flag = true;
				} else {
					flag = false;
				}
			} else {
				flag = false;
			}
		} else {
			flag = false;
		}
		
		if(flag) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
			
		}

	}
} public class Main{
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);

		int a[][] = new int[3][3];
		boolean flag = true;
		for (int j = 0; j < 3; j++) {
			for (int i = 0; i < 3; i++) {
				a[i][j] = in.nextInt();
			}
		}

		int sa1 = a[0][1] - a[0][0];
		int sa2 = a[1][1] - a[1][0];
		int sa3 = a[2][1] - a[2][0];

		int sa21 = a[0][2] - a[0][0];
		int sa22 = a[1][2] - a[1][0];
		int sa23 = a[2][2] - a[2][0];

		int sa31 = a[0][2] - a[0][1];
		int sa32 = a[1][2] - a[1][1];
		int sa33 = a[2][2] - a[2][1];

		if (sa1 == sa2 && sa1 == sa3) {
			if (sa21 == sa22 && sa21 == sa23) {
				if (sa31 == sa32 && sa31 == sa33) {
					flag = true;
				} else {
					flag = false;
				}
			} else {
				flag = false;
			}
		} else {
			flag = false;
		}
		
		if(flag) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
			
		}

	}
} Main


import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);

		int a[][] = new int[3][3];
		boolean flag = true;
		for (int j = 0; j < 3; j++) {
			for (int i = 0; i < 3; i++) {
				a[i][j] = in.nextInt();
			}
		}

		int sa1 = a[0][1] - a[0][0];
		int sa2 = a[1][1] - a[1][0];
		int sa3 = a[2][1] - a[2][0];

		int sa21 = a[0][2] - a[0][0];
		int sa22 = a[1][2] - a[1][0];
		int sa23 = a[2][2] - a[2][0];

		int sa31 = a[0][2] - a[0][1];
		int sa32 = a[1][2] - a[1][1];
		int sa33 = a[2][2] - a[2][1];

		if (sa1 == sa2 && sa1 == sa3) {
			if (sa21 == sa22 && sa21 == sa23) {
				if (sa31 == sa32 && sa31 == sa33) {
					flag = true;
				} else {
					flag = false;
				}
			} else {
				flag = false;
			}
		} else {
			flag = false;
		}
		
		if(flag) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
			
		}

	}
}
