import java.util.*;
public class Main {
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		
		int[] a = new int[9];
		for(int i = 0; i < 9; i++){
			a[i] = sc.nextInt();
		}
		int b1 = a[0];
		int b2 = a[1];
		int b3 = a[2];
		
		int a1 = 0;
		int a2 = a[3] - b1;
		int a3 = a[6] - b1;
		
		int check = 0;
		if(a[4] != a2 + b2 || a[5] != a2 + b3 || a[7] != a3 + b2 || a[8] != a3 + b3){
			check++;
		}
		
		if(check == 0){
			System.out.println("Yes");
		}else{
			System.out.println("No");
		}
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		
		int[] a = new int[9];
		for(int i = 0; i < 9; i++){
			a[i] = sc.nextInt();
		}
		int b1 = a[0];
		int b2 = a[1];
		int b3 = a[2];
		
		int a1 = 0;
		int a2 = a[3] - b1;
		int a3 = a[6] - b1;
		
		int check = 0;
		if(a[4] != a2 + b2 || a[5] != a2 + b3 || a[7] != a3 + b2 || a[8] != a3 + b3){
			check++;
		}
		
		if(check == 0){
			System.out.println("Yes");
		}else{
			System.out.println("No");
		}
	}
} Main public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		
		int[] a = new int[9];
		for(int i = 0; i < 9; i++){
			a[i] = sc.nextInt();
		}
		int b1 = a[0];
		int b2 = a[1];
		int b3 = a[2];
		
		int a1 = 0;
		int a2 = a[3] - b1;
		int a3 = a[6] - b1;
		
		int check = 0;
		if(a[4] != a2 + b2 || a[5] != a2 + b3 || a[7] != a3 + b2 || a[8] != a3 + b3){
			check++;
		}
		
		if(check == 0){
			System.out.println("Yes");
		}else{
			System.out.println("No");
		}
	} main {
		
		Scanner sc = new Scanner(System.in);
		
		int[] a = new int[9];
		for(int i = 0; i < 9; i++){
			a[i] = sc.nextInt();
		}
		int b1 = a[0];
		int b2 = a[1];
		int b3 = a[2];
		
		int a1 = 0;
		int a2 = a[3] - b1;
		int a3 = a[6] - b1;
		
		int check = 0;
		if(a[4] != a2 + b2 || a[5] != a2 + b3 || a[7] != a3 + b2 || a[8] != a3 + b3){
			check++;
		}
		
		if(check == 0){
			System.out.println("Yes");
		}else{
			System.out.println("No");
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] a = new int[9]; a new int[9] 9 for(int i = 0; i < 9; i++){
			a[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < 9 i 9 i++ i++ i {
			a[i] = sc.nextInt();
		} {
			a[i] = sc.nextInt();
		} a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc int b1 = a[0]; b1 a[0] a 0 int b2 = a[1]; b2 a[1] a 1 int b3 = a[2]; b3 a[2] a 2 int a1 = 0; a1 0 int a2 = a[3] - b1; a2 a[3] - b1 a[3] a 3 b1 int a3 = a[6] - b1; a3 a[6] - b1 a[6] a 6 b1 int check = 0; check 0 if(a[4] != a2 + b2 || a[5] != a2 + b3 || a[7] != a3 + b2 || a[8] != a3 + b3){
			check++;
		} a[4] != a2 + b2 || a[5] != a2 + b3 || a[7] != a3 + b2 || a[8] != a3 + b3 a[7] != a3 + b2 a[4] != a2 + b2 || a[5] != a2 + b3 || a[7] != a3 + b2 || a[8] != a3 + b3 a[4] != a2 + b2 a[4] a 4 a2 + b2 a2 b2 a[5] != a2 + b3 a[5] a 5 a2 + b3 a2 b3 a[7] != a3 + b2 a[7] a 7 a3 + b2 a3 b2 a[8] != a3 + b3 a[8] a 8 a3 + b3 a3 b3 {
			check++;
		} check++ check if(check == 0){
			System.out.println("Yes");
		}else{
			System.out.println("No");
		} check == 0 check 0 {
			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 sc = new Scanner(System.in);
		
		int[] a = new int[9];
		for(int i = 0; i < 9; i++){
			a[i] = sc.nextInt();
		}
		int b1 = a[0];
		int b2 = a[1];
		int b3 = a[2];
		
		int a1 = 0;
		int a2 = a[3] - b1;
		int a3 = a[6] - b1;
		
		int check = 0;
		if(a[4] != a2 + b2 || a[5] != a2 + b3 || a[7] != a3 + b2 || a[8] != a3 + b3){
			check++;
		}
		
		if(check == 0){
			System.out.println("Yes");
		}else{
			System.out.println("No");
		}
	}
} public class Main {
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		
		int[] a = new int[9];
		for(int i = 0; i < 9; i++){
			a[i] = sc.nextInt();
		}
		int b1 = a[0];
		int b2 = a[1];
		int b3 = a[2];
		
		int a1 = 0;
		int a2 = a[3] - b1;
		int a3 = a[6] - b1;
		
		int check = 0;
		if(a[4] != a2 + b2 || a[5] != a2 + b3 || a[7] != a3 + b2 || a[8] != a3 + b3){
			check++;
		}
		
		if(check == 0){
			System.out.println("Yes");
		}else{
			System.out.println("No");
		}
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		
		int[] a = new int[9];
		for(int i = 0; i < 9; i++){
			a[i] = sc.nextInt();
		}
		int b1 = a[0];
		int b2 = a[1];
		int b3 = a[2];
		
		int a1 = 0;
		int a2 = a[3] - b1;
		int a3 = a[6] - b1;
		
		int check = 0;
		if(a[4] != a2 + b2 || a[5] != a2 + b3 || a[7] != a3 + b2 || a[8] != a3 + b3){
			check++;
		}
		
		if(check == 0){
			System.out.println("Yes");
		}else{
			System.out.println("No");
		}
	}
}
