

import java.io.IOException;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		int matrix[][] = new int[3][3];

		for(int i = 0; i < 3; i++){
			for(int j = 0; j < 3; j++){
				matrix[i][j] = sc.nextInt();
			}
		}

		for(int j = 0; j < 2; j++){
			for(int i = 1; i < 3; i++){
				if(matrix[i - 1][j] - matrix[i - 1][j + 1] != matrix[i][j] - matrix[i][j + 1]){
					System.out.println("No");
					return;
				}
			}
		}
		for(int i = 0; i < 2; i++){
			for(int j = 1; j < 3; j++){
				if(matrix[i + 1][j - 1] - matrix[i][j - 1] != matrix[i + 1][j] - matrix[i][j]){
					System.out.println("No");
					return;
				}
			}
		}

		System.out.println("Yes");
	}


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

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		int matrix[][] = new int[3][3];

		for(int i = 0; i < 3; i++){
			for(int j = 0; j < 3; j++){
				matrix[i][j] = sc.nextInt();
			}
		}

		for(int j = 0; j < 2; j++){
			for(int i = 1; i < 3; i++){
				if(matrix[i - 1][j] - matrix[i - 1][j + 1] != matrix[i][j] - matrix[i][j + 1]){
					System.out.println("No");
					return;
				}
			}
		}
		for(int i = 0; i < 2; i++){
			for(int j = 1; j < 3; j++){
				if(matrix[i + 1][j - 1] - matrix[i][j - 1] != matrix[i + 1][j] - matrix[i][j]){
					System.out.println("No");
					return;
				}
			}
		}

		System.out.println("Yes");
	}


} Main public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		int matrix[][] = new int[3][3];

		for(int i = 0; i < 3; i++){
			for(int j = 0; j < 3; j++){
				matrix[i][j] = sc.nextInt();
			}
		}

		for(int j = 0; j < 2; j++){
			for(int i = 1; i < 3; i++){
				if(matrix[i - 1][j] - matrix[i - 1][j + 1] != matrix[i][j] - matrix[i][j + 1]){
					System.out.println("No");
					return;
				}
			}
		}
		for(int i = 0; i < 2; i++){
			for(int j = 1; j < 3; j++){
				if(matrix[i + 1][j - 1] - matrix[i][j - 1] != matrix[i + 1][j] - matrix[i][j]){
					System.out.println("No");
					return;
				}
			}
		}

		System.out.println("Yes");
	} main {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		int matrix[][] = new int[3][3];

		for(int i = 0; i < 3; i++){
			for(int j = 0; j < 3; j++){
				matrix[i][j] = sc.nextInt();
			}
		}

		for(int j = 0; j < 2; j++){
			for(int i = 1; i < 3; i++){
				if(matrix[i - 1][j] - matrix[i - 1][j + 1] != matrix[i][j] - matrix[i][j + 1]){
					System.out.println("No");
					return;
				}
			}
		}
		for(int i = 0; i < 2; i++){
			for(int j = 1; j < 3; j++){
				if(matrix[i + 1][j - 1] - matrix[i][j - 1] != matrix[i + 1][j] - matrix[i][j]){
					System.out.println("No");
					return;
				}
			}
		}

		System.out.println("Yes");
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int matrix[][] = new int[3][3]; matrix new int[3][3] 3 3 for(int i = 0; i < 3; i++){
			for(int j = 0; j < 3; j++){
				matrix[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++){
				matrix[i][j] = sc.nextInt();
			}
		} {
			for(int j = 0; j < 3; j++){
				matrix[i][j] = sc.nextInt();
			}
		} for(int j = 0; j < 3; j++){
				matrix[i][j] = sc.nextInt();
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				matrix[i][j] = sc.nextInt();
			} {
				matrix[i][j] = sc.nextInt();
			} matrix[i][j] = sc.nextInt() matrix[i][j] matrix[i] matrix i j sc.nextInt() sc.nextInt sc for(int j = 0; j < 2; j++){
			for(int i = 1; i < 3; i++){
				if(matrix[i - 1][j] - matrix[i - 1][j + 1] != matrix[i][j] - matrix[i][j + 1]){
					System.out.println("No");
					return;
				}
			}
		} int j = 0; int j = 0; j 0 j < 2 j 2 j++ j++ j {
			for(int i = 1; i < 3; i++){
				if(matrix[i - 1][j] - matrix[i - 1][j + 1] != matrix[i][j] - matrix[i][j + 1]){
					System.out.println("No");
					return;
				}
			}
		} {
			for(int i = 1; i < 3; i++){
				if(matrix[i - 1][j] - matrix[i - 1][j + 1] != matrix[i][j] - matrix[i][j + 1]){
					System.out.println("No");
					return;
				}
			}
		} for(int i = 1; i < 3; i++){
				if(matrix[i - 1][j] - matrix[i - 1][j + 1] != matrix[i][j] - matrix[i][j + 1]){
					System.out.println("No");
					return;
				}
			} int i = 1; int i = 1; i 1 i < 3 i 3 i++ i++ i {
				if(matrix[i - 1][j] - matrix[i - 1][j + 1] != matrix[i][j] - matrix[i][j + 1]){
					System.out.println("No");
					return;
				}
			} {
				if(matrix[i - 1][j] - matrix[i - 1][j + 1] != matrix[i][j] - matrix[i][j + 1]){
					System.out.println("No");
					return;
				}
			} if(matrix[i - 1][j] - matrix[i - 1][j + 1] != matrix[i][j] - matrix[i][j + 1]){
					System.out.println("No");
					return;
				} matrix[i - 1][j] - matrix[i - 1][j + 1] != matrix[i][j] - matrix[i][j + 1] matrix[i - 1][j] - matrix[i - 1][j + 1] matrix[i - 1][j] matrix[i - 1] matrix i - 1 i 1 j matrix[i - 1][j + 1] matrix[i - 1] matrix i - 1 i 1 j + 1 j 1 matrix[i][j] - matrix[i][j + 1] matrix[i][j] matrix[i] matrix i j matrix[i][j + 1] matrix[i] matrix i j + 1 j 1 {
					System.out.println("No");
					return;
				} System.out.println("No") System.out.println System.out System System.out "No" return; for(int i = 0; i < 2; i++){
			for(int j = 1; j < 3; j++){
				if(matrix[i + 1][j - 1] - matrix[i][j - 1] != matrix[i + 1][j] - matrix[i][j]){
					System.out.println("No");
					return;
				}
			}
		} int i = 0; int i = 0; i 0 i < 2 i 2 i++ i++ i {
			for(int j = 1; j < 3; j++){
				if(matrix[i + 1][j - 1] - matrix[i][j - 1] != matrix[i + 1][j] - matrix[i][j]){
					System.out.println("No");
					return;
				}
			}
		} {
			for(int j = 1; j < 3; j++){
				if(matrix[i + 1][j - 1] - matrix[i][j - 1] != matrix[i + 1][j] - matrix[i][j]){
					System.out.println("No");
					return;
				}
			}
		} for(int j = 1; j < 3; j++){
				if(matrix[i + 1][j - 1] - matrix[i][j - 1] != matrix[i + 1][j] - matrix[i][j]){
					System.out.println("No");
					return;
				}
			} int j = 1; int j = 1; j 1 j < 3 j 3 j++ j++ j {
				if(matrix[i + 1][j - 1] - matrix[i][j - 1] != matrix[i + 1][j] - matrix[i][j]){
					System.out.println("No");
					return;
				}
			} {
				if(matrix[i + 1][j - 1] - matrix[i][j - 1] != matrix[i + 1][j] - matrix[i][j]){
					System.out.println("No");
					return;
				}
			} if(matrix[i + 1][j - 1] - matrix[i][j - 1] != matrix[i + 1][j] - matrix[i][j]){
					System.out.println("No");
					return;
				} matrix[i + 1][j - 1] - matrix[i][j - 1] != matrix[i + 1][j] - matrix[i][j] matrix[i + 1][j - 1] - matrix[i][j - 1] matrix[i + 1][j - 1] matrix[i + 1] matrix i + 1 i 1 j - 1 j 1 matrix[i][j - 1] matrix[i] matrix i j - 1 j 1 matrix[i + 1][j] - matrix[i][j] matrix[i + 1][j] matrix[i + 1] matrix i + 1 i 1 j matrix[i][j] matrix[i] matrix i j {
					System.out.println("No");
					return;
				} System.out.println("No") System.out.println System.out System System.out "No" return; System.out.println("Yes") System.out.println System.out System System.out "Yes" String[] args args public class Main {

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		int matrix[][] = new int[3][3];

		for(int i = 0; i < 3; i++){
			for(int j = 0; j < 3; j++){
				matrix[i][j] = sc.nextInt();
			}
		}

		for(int j = 0; j < 2; j++){
			for(int i = 1; i < 3; i++){
				if(matrix[i - 1][j] - matrix[i - 1][j + 1] != matrix[i][j] - matrix[i][j + 1]){
					System.out.println("No");
					return;
				}
			}
		}
		for(int i = 0; i < 2; i++){
			for(int j = 1; j < 3; j++){
				if(matrix[i + 1][j - 1] - matrix[i][j - 1] != matrix[i + 1][j] - matrix[i][j]){
					System.out.println("No");
					return;
				}
			}
		}

		System.out.println("Yes");
	}


} public class Main {

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		int matrix[][] = new int[3][3];

		for(int i = 0; i < 3; i++){
			for(int j = 0; j < 3; j++){
				matrix[i][j] = sc.nextInt();
			}
		}

		for(int j = 0; j < 2; j++){
			for(int i = 1; i < 3; i++){
				if(matrix[i - 1][j] - matrix[i - 1][j + 1] != matrix[i][j] - matrix[i][j + 1]){
					System.out.println("No");
					return;
				}
			}
		}
		for(int i = 0; i < 2; i++){
			for(int j = 1; j < 3; j++){
				if(matrix[i + 1][j - 1] - matrix[i][j - 1] != matrix[i + 1][j] - matrix[i][j]){
					System.out.println("No");
					return;
				}
			}
		}

		System.out.println("Yes");
	}


} Main


import java.io.IOException;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		int matrix[][] = new int[3][3];

		for(int i = 0; i < 3; i++){
			for(int j = 0; j < 3; j++){
				matrix[i][j] = sc.nextInt();
			}
		}

		for(int j = 0; j < 2; j++){
			for(int i = 1; i < 3; i++){
				if(matrix[i - 1][j] - matrix[i - 1][j + 1] != matrix[i][j] - matrix[i][j + 1]){
					System.out.println("No");
					return;
				}
			}
		}
		for(int i = 0; i < 2; i++){
			for(int j = 1; j < 3; j++){
				if(matrix[i + 1][j - 1] - matrix[i][j - 1] != matrix[i + 1][j] - matrix[i][j]){
					System.out.println("No");
					return;
				}
			}
		}

		System.out.println("Yes");
	}


}
