import java.io.File;
import java.io.IOException;
import java.lang.reflect.Array;
import java.util.*;
import java.util.Map.Entry;

public class Main{
	
	public static void main(String[] args) throws IOException{
		//File file = new File("input.txt");
		//Scanner in = new Scanner(file);
		Scanner in = new Scanner(System.in);
		
		boolean ans = true;
		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();
			}
		}
		
		if(!(c[0][0] - c[0][1] == c[1][0] - c[1][1] && c[2][0] - c[2][1] == c[1][0] - c[1][1])) ans = false;
		if(!(c[0][2] - c[0][1] == c[1][2] - c[1][1] && c[2][2] - c[2][1] == c[1][2] - c[1][1])) ans = false;
		
		if(!(c[0][0] - c[1][0] == c[0][1] - c[1][1] && c[0][2] - c[1][2] == c[0][1] - c[1][1])) ans = false;
		if(!(c[2][0] - c[1][0] == c[2][1] - c[1][1] && c[2][2] - c[1][2] == c[2][1] - c[1][1])) ans = false;
		
		System.out.println(ans ? "Yes" : "No");
	}
} import java.io.File; File java.io import java.io.IOException; IOException java.io import java.lang.reflect.Array; Array java.lang.reflect import java.util.*; util.* java import java.util.Map.Entry; Entry java.util.Map public class Main{
	
	public static void main(String[] args) throws IOException{
		//File file = new File("input.txt");
		//Scanner in = new Scanner(file);
		Scanner in = new Scanner(System.in);
		
		boolean ans = true;
		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();
			}
		}
		
		if(!(c[0][0] - c[0][1] == c[1][0] - c[1][1] && c[2][0] - c[2][1] == c[1][0] - c[1][1])) ans = false;
		if(!(c[0][2] - c[0][1] == c[1][2] - c[1][1] && c[2][2] - c[2][1] == c[1][2] - c[1][1])) ans = false;
		
		if(!(c[0][0] - c[1][0] == c[0][1] - c[1][1] && c[0][2] - c[1][2] == c[0][1] - c[1][1])) ans = false;
		if(!(c[2][0] - c[1][0] == c[2][1] - c[1][1] && c[2][2] - c[1][2] == c[2][1] - c[1][1])) ans = false;
		
		System.out.println(ans ? "Yes" : "No");
	}
} Main public static void main(String[] args) throws IOException{
		//File file = new File("input.txt");
		//Scanner in = new Scanner(file);
		Scanner in = new Scanner(System.in);
		
		boolean ans = true;
		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();
			}
		}
		
		if(!(c[0][0] - c[0][1] == c[1][0] - c[1][1] && c[2][0] - c[2][1] == c[1][0] - c[1][1])) ans = false;
		if(!(c[0][2] - c[0][1] == c[1][2] - c[1][1] && c[2][2] - c[2][1] == c[1][2] - c[1][1])) ans = false;
		
		if(!(c[0][0] - c[1][0] == c[0][1] - c[1][1] && c[0][2] - c[1][2] == c[0][1] - c[1][1])) ans = false;
		if(!(c[2][0] - c[1][0] == c[2][1] - c[1][1] && c[2][2] - c[1][2] == c[2][1] - c[1][1])) ans = false;
		
		System.out.println(ans ? "Yes" : "No");
	} main {
		//File file = new File("input.txt");
		//Scanner in = new Scanner(file);
		Scanner in = new Scanner(System.in);
		
		boolean ans = true;
		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();
			}
		}
		
		if(!(c[0][0] - c[0][1] == c[1][0] - c[1][1] && c[2][0] - c[2][1] == c[1][0] - c[1][1])) ans = false;
		if(!(c[0][2] - c[0][1] == c[1][2] - c[1][1] && c[2][2] - c[2][1] == c[1][2] - c[1][1])) ans = false;
		
		if(!(c[0][0] - c[1][0] == c[0][1] - c[1][1] && c[0][2] - c[1][2] == c[0][1] - c[1][1])) ans = false;
		if(!(c[2][0] - c[1][0] == c[2][1] - c[1][1] && c[2][2] - c[1][2] == c[2][1] - c[1][1])) ans = false;
		
		System.out.println(ans ? "Yes" : "No");
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) boolean ans = true; ans true 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 if(!(c[0][0] - c[0][1] == c[1][0] - c[1][1] && c[2][0] - c[2][1] == c[1][0] - c[1][1])) ans = false; !(c[0][0] - c[0][1] == c[1][0] - c[1][1] && c[2][0] - c[2][1] == c[1][0] - c[1][1]) (c[0][0] - c[0][1] == c[1][0] - c[1][1] && c[2][0] - c[2][1] == c[1][0] - c[1][1]) c[0][0] - c[0][1] == c[1][0] - c[1][1] c[0][0] - c[0][1] c[0][0] c[0] c 0 0 c[0][1] c[0] c 0 1 c[1][0] - c[1][1] c[1][0] c[1] c 1 0 c[1][1] c[1] c 1 1 c[2][0] - c[2][1] == c[1][0] - c[1][1] c[2][0] - c[2][1] c[2][0] c[2] c 2 0 c[2][1] c[2] c 2 1 c[1][0] - c[1][1] c[1][0] c[1] c 1 0 c[1][1] c[1] c 1 1 ans = false ans false if(!(c[0][2] - c[0][1] == c[1][2] - c[1][1] && c[2][2] - c[2][1] == c[1][2] - c[1][1])) ans = false; !(c[0][2] - c[0][1] == c[1][2] - c[1][1] && c[2][2] - c[2][1] == c[1][2] - c[1][1]) (c[0][2] - c[0][1] == c[1][2] - c[1][1] && c[2][2] - c[2][1] == c[1][2] - c[1][1]) c[0][2] - c[0][1] == c[1][2] - c[1][1] c[0][2] - c[0][1] c[0][2] c[0] c 0 2 c[0][1] c[0] c 0 1 c[1][2] - c[1][1] c[1][2] c[1] c 1 2 c[1][1] c[1] c 1 1 c[2][2] - c[2][1] == c[1][2] - c[1][1] c[2][2] - c[2][1] c[2][2] c[2] c 2 2 c[2][1] c[2] c 2 1 c[1][2] - c[1][1] c[1][2] c[1] c 1 2 c[1][1] c[1] c 1 1 ans = false ans false if(!(c[0][0] - c[1][0] == c[0][1] - c[1][1] && c[0][2] - c[1][2] == c[0][1] - c[1][1])) ans = false; !(c[0][0] - c[1][0] == c[0][1] - c[1][1] && c[0][2] - c[1][2] == c[0][1] - c[1][1]) (c[0][0] - c[1][0] == c[0][1] - c[1][1] && c[0][2] - c[1][2] == c[0][1] - c[1][1]) c[0][0] - c[1][0] == c[0][1] - c[1][1] c[0][0] - c[1][0] c[0][0] c[0] c 0 0 c[1][0] c[1] c 1 0 c[0][1] - c[1][1] c[0][1] c[0] c 0 1 c[1][1] c[1] c 1 1 c[0][2] - c[1][2] == c[0][1] - c[1][1] c[0][2] - c[1][2] c[0][2] c[0] c 0 2 c[1][2] c[1] c 1 2 c[0][1] - c[1][1] c[0][1] c[0] c 0 1 c[1][1] c[1] c 1 1 ans = false ans false if(!(c[2][0] - c[1][0] == c[2][1] - c[1][1] && c[2][2] - c[1][2] == c[2][1] - c[1][1])) ans = false; !(c[2][0] - c[1][0] == c[2][1] - c[1][1] && c[2][2] - c[1][2] == c[2][1] - c[1][1]) (c[2][0] - c[1][0] == c[2][1] - c[1][1] && c[2][2] - c[1][2] == c[2][1] - c[1][1]) c[2][0] - c[1][0] == c[2][1] - c[1][1] c[2][0] - c[1][0] c[2][0] c[2] c 2 0 c[1][0] c[1] c 1 0 c[2][1] - c[1][1] c[2][1] c[2] c 2 1 c[1][1] c[1] c 1 1 c[2][2] - c[1][2] == c[2][1] - c[1][1] c[2][2] - c[1][2] c[2][2] c[2] c 2 2 c[1][2] c[1] c 1 2 c[2][1] - c[1][1] c[2][1] c[2] c 2 1 c[1][1] c[1] c 1 1 ans = false ans false System.out.println(ans ? "Yes" : "No") System.out.println System.out System System.out ans ? "Yes" : "No" ans "Yes" "No" String[] args args public class Main{
	
	public static void main(String[] args) throws IOException{
		//File file = new File("input.txt");
		//Scanner in = new Scanner(file);
		Scanner in = new Scanner(System.in);
		
		boolean ans = true;
		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();
			}
		}
		
		if(!(c[0][0] - c[0][1] == c[1][0] - c[1][1] && c[2][0] - c[2][1] == c[1][0] - c[1][1])) ans = false;
		if(!(c[0][2] - c[0][1] == c[1][2] - c[1][1] && c[2][2] - c[2][1] == c[1][2] - c[1][1])) ans = false;
		
		if(!(c[0][0] - c[1][0] == c[0][1] - c[1][1] && c[0][2] - c[1][2] == c[0][1] - c[1][1])) ans = false;
		if(!(c[2][0] - c[1][0] == c[2][1] - c[1][1] && c[2][2] - c[1][2] == c[2][1] - c[1][1])) ans = false;
		
		System.out.println(ans ? "Yes" : "No");
	}
} public class Main{
	
	public static void main(String[] args) throws IOException{
		//File file = new File("input.txt");
		//Scanner in = new Scanner(file);
		Scanner in = new Scanner(System.in);
		
		boolean ans = true;
		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();
			}
		}
		
		if(!(c[0][0] - c[0][1] == c[1][0] - c[1][1] && c[2][0] - c[2][1] == c[1][0] - c[1][1])) ans = false;
		if(!(c[0][2] - c[0][1] == c[1][2] - c[1][1] && c[2][2] - c[2][1] == c[1][2] - c[1][1])) ans = false;
		
		if(!(c[0][0] - c[1][0] == c[0][1] - c[1][1] && c[0][2] - c[1][2] == c[0][1] - c[1][1])) ans = false;
		if(!(c[2][0] - c[1][0] == c[2][1] - c[1][1] && c[2][2] - c[1][2] == c[2][1] - c[1][1])) ans = false;
		
		System.out.println(ans ? "Yes" : "No");
	}
} Main
import java.io.File;
import java.io.IOException;
import java.lang.reflect.Array;
import java.util.*;
import java.util.Map.Entry;

public class Main{
	
	public static void main(String[] args) throws IOException{
		//File file = new File("input.txt");
		//Scanner in = new Scanner(file);
		Scanner in = new Scanner(System.in);
		
		boolean ans = true;
		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();
			}
		}
		
		if(!(c[0][0] - c[0][1] == c[1][0] - c[1][1] && c[2][0] - c[2][1] == c[1][0] - c[1][1])) ans = false;
		if(!(c[0][2] - c[0][1] == c[1][2] - c[1][1] && c[2][2] - c[2][1] == c[1][2] - c[1][1])) ans = false;
		
		if(!(c[0][0] - c[1][0] == c[0][1] - c[1][1] && c[0][2] - c[1][2] == c[0][1] - c[1][1])) ans = false;
		if(!(c[2][0] - c[1][0] == c[2][1] - c[1][1] && c[2][2] - c[1][2] == c[2][1] - c[1][1])) ans = false;
		
		System.out.println(ans ? "Yes" : "No");
	}
}
