import java.util.Scanner;

public class Main {

	public static void main(String[] args) {


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

		if(grid[0][1]-grid[0][0] != grid[1][1]-grid[1][0]) {
			System.out.println("No");
			return;
		}
		if(grid[1][1]-grid[1][0] != grid[2][1]-grid[2][0]) {
			System.out.println("No");
			return;
		}
		if(grid[0][2]-grid[0][1] != grid[1][2]-grid[1][1]) {
			System.out.println("No");
			return;
		}
		if(grid[1][2]-grid[1][1] != grid[2][2]-grid[2][1]) {
			System.out.println("No");
			return;
		}
		System.out.println("Yes");
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {


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

		if(grid[0][1]-grid[0][0] != grid[1][1]-grid[1][0]) {
			System.out.println("No");
			return;
		}
		if(grid[1][1]-grid[1][0] != grid[2][1]-grid[2][0]) {
			System.out.println("No");
			return;
		}
		if(grid[0][2]-grid[0][1] != grid[1][2]-grid[1][1]) {
			System.out.println("No");
			return;
		}
		if(grid[1][2]-grid[1][1] != grid[2][2]-grid[2][1]) {
			System.out.println("No");
			return;
		}
		System.out.println("Yes");
	}
} Main public static void main(String[] args) {


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

		if(grid[0][1]-grid[0][0] != grid[1][1]-grid[1][0]) {
			System.out.println("No");
			return;
		}
		if(grid[1][1]-grid[1][0] != grid[2][1]-grid[2][0]) {
			System.out.println("No");
			return;
		}
		if(grid[0][2]-grid[0][1] != grid[1][2]-grid[1][1]) {
			System.out.println("No");
			return;
		}
		if(grid[1][2]-grid[1][1] != grid[2][2]-grid[2][1]) {
			System.out.println("No");
			return;
		}
		System.out.println("Yes");
	} main {


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

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


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

		if(grid[0][1]-grid[0][0] != grid[1][1]-grid[1][0]) {
			System.out.println("No");
			return;
		}
		if(grid[1][1]-grid[1][0] != grid[2][1]-grid[2][0]) {
			System.out.println("No");
			return;
		}
		if(grid[0][2]-grid[0][1] != grid[1][2]-grid[1][1]) {
			System.out.println("No");
			return;
		}
		if(grid[1][2]-grid[1][1] != grid[2][2]-grid[2][1]) {
			System.out.println("No");
			return;
		}
		System.out.println("Yes");
	}
} public class Main {

	public static void main(String[] args) {


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

		if(grid[0][1]-grid[0][0] != grid[1][1]-grid[1][0]) {
			System.out.println("No");
			return;
		}
		if(grid[1][1]-grid[1][0] != grid[2][1]-grid[2][0]) {
			System.out.println("No");
			return;
		}
		if(grid[0][2]-grid[0][1] != grid[1][2]-grid[1][1]) {
			System.out.println("No");
			return;
		}
		if(grid[1][2]-grid[1][1] != grid[2][2]-grid[2][1]) {
			System.out.println("No");
			return;
		}
		System.out.println("Yes");
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {


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

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