import java.util.*;
import java.util.Arrays;
public class Main{
	public static void main(String[] args){
		Scanner sc = 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] = sc.nextInt();
			}
		}
		
		int w = 0;
		
		int a[] = new int[3];
		int b[] = new int[3];

		for(w = 0;w<=100;w++){
	
			a[0] = w;
			b[0] = c[0][0] - a[0];
			b[1] = c[0][1] - a[0];
			b[2] = c[0][2] - a[0];

			for(int i=0;i<3;i++){
				if(b[i] < 0){
					System.out.println("No");
					return;
				}
			}
			
			int aa[][] = new int[3][3];

			for(int i = 1;i<3;i++){
				for(int j=0;j<3;j++){
					aa[i][j] = c[i][j] - b[j];
				}
			}

			if(aa[1][0] != aa[1][1] || aa[1][0] != aa[1][2] || aa[2][0] != aa[2][1] || aa[2][0] != aa[2][2]){
				continue;
			}
			
		System.out.println("Yes");
		return;
		}
			System.out.println("No");	
	}
}

 import java.util.*; util.* java import java.util.Arrays; Arrays java.util public class Main{
	public static void main(String[] args){
		Scanner sc = 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] = sc.nextInt();
			}
		}
		
		int w = 0;
		
		int a[] = new int[3];
		int b[] = new int[3];

		for(w = 0;w<=100;w++){
	
			a[0] = w;
			b[0] = c[0][0] - a[0];
			b[1] = c[0][1] - a[0];
			b[2] = c[0][2] - a[0];

			for(int i=0;i<3;i++){
				if(b[i] < 0){
					System.out.println("No");
					return;
				}
			}
			
			int aa[][] = new int[3][3];

			for(int i = 1;i<3;i++){
				for(int j=0;j<3;j++){
					aa[i][j] = c[i][j] - b[j];
				}
			}

			if(aa[1][0] != aa[1][1] || aa[1][0] != aa[1][2] || aa[2][0] != aa[2][1] || aa[2][0] != aa[2][2]){
				continue;
			}
			
		System.out.println("Yes");
		return;
		}
			System.out.println("No");	
	}
} Main public static void main(String[] args){
		Scanner sc = 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] = sc.nextInt();
			}
		}
		
		int w = 0;
		
		int a[] = new int[3];
		int b[] = new int[3];

		for(w = 0;w<=100;w++){
	
			a[0] = w;
			b[0] = c[0][0] - a[0];
			b[1] = c[0][1] - a[0];
			b[2] = c[0][2] - a[0];

			for(int i=0;i<3;i++){
				if(b[i] < 0){
					System.out.println("No");
					return;
				}
			}
			
			int aa[][] = new int[3][3];

			for(int i = 1;i<3;i++){
				for(int j=0;j<3;j++){
					aa[i][j] = c[i][j] - b[j];
				}
			}

			if(aa[1][0] != aa[1][1] || aa[1][0] != aa[1][2] || aa[2][0] != aa[2][1] || aa[2][0] != aa[2][2]){
				continue;
			}
			
		System.out.println("Yes");
		return;
		}
			System.out.println("No");	
	} main {
		Scanner sc = 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] = sc.nextInt();
			}
		}
		
		int w = 0;
		
		int a[] = new int[3];
		int b[] = new int[3];

		for(w = 0;w<=100;w++){
	
			a[0] = w;
			b[0] = c[0][0] - a[0];
			b[1] = c[0][1] - a[0];
			b[2] = c[0][2] - a[0];

			for(int i=0;i<3;i++){
				if(b[i] < 0){
					System.out.println("No");
					return;
				}
			}
			
			int aa[][] = new int[3][3];

			for(int i = 1;i<3;i++){
				for(int j=0;j<3;j++){
					aa[i][j] = c[i][j] - b[j];
				}
			}

			if(aa[1][0] != aa[1][1] || aa[1][0] != aa[1][2] || aa[2][0] != aa[2][1] || aa[2][0] != aa[2][2]){
				continue;
			}
			
		System.out.println("Yes");
		return;
		}
			System.out.println("No");	
	} Scanner sc = new Scanner(System.in); sc 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] = sc.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] = sc.nextInt();
			}
		} {
			for(int j = 0; j<3; j++){
				c[i][j] = sc.nextInt();
			}
		} for(int j = 0; j<3; j++){
				c[i][j] = sc.nextInt();
			} int j = 0; int j = 0; j 0 j<3 j 3 j++ j++ j {
				c[i][j] = sc.nextInt();
			} {
				c[i][j] = sc.nextInt();
			} c[i][j] = sc.nextInt() c[i][j] c[i] c i j sc.nextInt() sc.nextInt sc int w = 0; w 0 int a[] = new int[3]; a new int[3] 3 int b[] = new int[3]; b new int[3] 3 for(w = 0;w<=100;w++){
	
			a[0] = w;
			b[0] = c[0][0] - a[0];
			b[1] = c[0][1] - a[0];
			b[2] = c[0][2] - a[0];

			for(int i=0;i<3;i++){
				if(b[i] < 0){
					System.out.println("No");
					return;
				}
			}
			
			int aa[][] = new int[3][3];

			for(int i = 1;i<3;i++){
				for(int j=0;j<3;j++){
					aa[i][j] = c[i][j] - b[j];
				}
			}

			if(aa[1][0] != aa[1][1] || aa[1][0] != aa[1][2] || aa[2][0] != aa[2][1] || aa[2][0] != aa[2][2]){
				continue;
			}
			
		System.out.println("Yes");
		return;
		} w = 0; w = 0 w 0 w<=100 w 100 w++ w++ w {
	
			a[0] = w;
			b[0] = c[0][0] - a[0];
			b[1] = c[0][1] - a[0];
			b[2] = c[0][2] - a[0];

			for(int i=0;i<3;i++){
				if(b[i] < 0){
					System.out.println("No");
					return;
				}
			}
			
			int aa[][] = new int[3][3];

			for(int i = 1;i<3;i++){
				for(int j=0;j<3;j++){
					aa[i][j] = c[i][j] - b[j];
				}
			}

			if(aa[1][0] != aa[1][1] || aa[1][0] != aa[1][2] || aa[2][0] != aa[2][1] || aa[2][0] != aa[2][2]){
				continue;
			}
			
		System.out.println("Yes");
		return;
		} {
	
			a[0] = w;
			b[0] = c[0][0] - a[0];
			b[1] = c[0][1] - a[0];
			b[2] = c[0][2] - a[0];

			for(int i=0;i<3;i++){
				if(b[i] < 0){
					System.out.println("No");
					return;
				}
			}
			
			int aa[][] = new int[3][3];

			for(int i = 1;i<3;i++){
				for(int j=0;j<3;j++){
					aa[i][j] = c[i][j] - b[j];
				}
			}

			if(aa[1][0] != aa[1][1] || aa[1][0] != aa[1][2] || aa[2][0] != aa[2][1] || aa[2][0] != aa[2][2]){
				continue;
			}
			
		System.out.println("Yes");
		return;
		} a[0] = w a[0] a 0 w b[0] = c[0][0] - a[0] b[0] b 0 c[0][0] - a[0] c[0][0] c[0] c 0 0 a[0] a 0 b[1] = c[0][1] - a[0] b[1] b 1 c[0][1] - a[0] c[0][1] c[0] c 0 1 a[0] a 0 b[2] = c[0][2] - a[0] b[2] b 2 c[0][2] - a[0] c[0][2] c[0] c 0 2 a[0] a 0 for(int i=0;i<3;i++){
				if(b[i] < 0){
					System.out.println("No");
					return;
				}
			} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
				if(b[i] < 0){
					System.out.println("No");
					return;
				}
			} {
				if(b[i] < 0){
					System.out.println("No");
					return;
				}
			} if(b[i] < 0){
					System.out.println("No");
					return;
				} b[i] < 0 b[i] b i 0 {
					System.out.println("No");
					return;
				} System.out.println("No") System.out.println System.out System System.out "No" return; int aa[][] = new int[3][3]; aa new int[3][3] 3 3 for(int i = 1;i<3;i++){
				for(int j=0;j<3;j++){
					aa[i][j] = c[i][j] - b[j];
				}
			} int i = 1; int i = 1; i 1 i<3 i 3 i++ i++ i {
				for(int j=0;j<3;j++){
					aa[i][j] = c[i][j] - b[j];
				}
			} {
				for(int j=0;j<3;j++){
					aa[i][j] = c[i][j] - b[j];
				}
			} for(int j=0;j<3;j++){
					aa[i][j] = c[i][j] - b[j];
				} int j=0; int j=0; j 0 j<3 j 3 j++ j++ j {
					aa[i][j] = c[i][j] - b[j];
				} {
					aa[i][j] = c[i][j] - b[j];
				} aa[i][j] = c[i][j] - b[j] aa[i][j] aa[i] aa i j c[i][j] - b[j] c[i][j] c[i] c i j b[j] b j if(aa[1][0] != aa[1][1] || aa[1][0] != aa[1][2] || aa[2][0] != aa[2][1] || aa[2][0] != aa[2][2]){
				continue;
			} aa[1][0] != aa[1][1] || aa[1][0] != aa[1][2] || aa[2][0] != aa[2][1] || aa[2][0] != aa[2][2] aa[2][0] != aa[2][1] aa[1][0] != aa[1][1] || aa[1][0] != aa[1][2] || aa[2][0] != aa[2][1] || aa[2][0] != aa[2][2] aa[1][0] != aa[1][1] aa[1][0] aa[1] aa 1 0 aa[1][1] aa[1] aa 1 1 aa[1][0] != aa[1][2] aa[1][0] aa[1] aa 1 0 aa[1][2] aa[1] aa 1 2 aa[2][0] != aa[2][1] aa[2][0] aa[2] aa 2 0 aa[2][1] aa[2] aa 2 1 aa[2][0] != aa[2][2] aa[2][0] aa[2] aa 2 0 aa[2][2] aa[2] aa 2 2 {
				continue;
			} continue; System.out.println("Yes") System.out.println System.out System System.out "Yes" return; 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 c[][] = new int[3][3];

		for(int i= 0;i<3;i++){
			for(int j = 0; j<3; j++){
				c[i][j] = sc.nextInt();
			}
		}
		
		int w = 0;
		
		int a[] = new int[3];
		int b[] = new int[3];

		for(w = 0;w<=100;w++){
	
			a[0] = w;
			b[0] = c[0][0] - a[0];
			b[1] = c[0][1] - a[0];
			b[2] = c[0][2] - a[0];

			for(int i=0;i<3;i++){
				if(b[i] < 0){
					System.out.println("No");
					return;
				}
			}
			
			int aa[][] = new int[3][3];

			for(int i = 1;i<3;i++){
				for(int j=0;j<3;j++){
					aa[i][j] = c[i][j] - b[j];
				}
			}

			if(aa[1][0] != aa[1][1] || aa[1][0] != aa[1][2] || aa[2][0] != aa[2][1] || aa[2][0] != aa[2][2]){
				continue;
			}
			
		System.out.println("Yes");
		return;
		}
			System.out.println("No");	
	}
} public class Main{
	public static void main(String[] args){
		Scanner sc = 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] = sc.nextInt();
			}
		}
		
		int w = 0;
		
		int a[] = new int[3];
		int b[] = new int[3];

		for(w = 0;w<=100;w++){
	
			a[0] = w;
			b[0] = c[0][0] - a[0];
			b[1] = c[0][1] - a[0];
			b[2] = c[0][2] - a[0];

			for(int i=0;i<3;i++){
				if(b[i] < 0){
					System.out.println("No");
					return;
				}
			}
			
			int aa[][] = new int[3][3];

			for(int i = 1;i<3;i++){
				for(int j=0;j<3;j++){
					aa[i][j] = c[i][j] - b[j];
				}
			}

			if(aa[1][0] != aa[1][1] || aa[1][0] != aa[1][2] || aa[2][0] != aa[2][1] || aa[2][0] != aa[2][2]){
				continue;
			}
			
		System.out.println("Yes");
		return;
		}
			System.out.println("No");	
	}
} Main
import java.util.*;
import java.util.Arrays;
public class Main{
	public static void main(String[] args){
		Scanner sc = 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] = sc.nextInt();
			}
		}
		
		int w = 0;
		
		int a[] = new int[3];
		int b[] = new int[3];

		for(w = 0;w<=100;w++){
	
			a[0] = w;
			b[0] = c[0][0] - a[0];
			b[1] = c[0][1] - a[0];
			b[2] = c[0][2] - a[0];

			for(int i=0;i<3;i++){
				if(b[i] < 0){
					System.out.println("No");
					return;
				}
			}
			
			int aa[][] = new int[3][3];

			for(int i = 1;i<3;i++){
				for(int j=0;j<3;j++){
					aa[i][j] = c[i][j] - b[j];
				}
			}

			if(aa[1][0] != aa[1][1] || aa[1][0] != aa[1][2] || aa[2][0] != aa[2][1] || aa[2][0] != aa[2][2]){
				continue;
			}
			
		System.out.println("Yes");
		return;
		}
			System.out.println("No");	
	}
}


