
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();
			}
		}
		for(int i = 1; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				grid[i][j] -= grid[0][j];
			}
		}
		boolean ans = false;
		if(grid[1][0] == grid[1][1] && grid[1][1] == grid[1][2] && grid[2][0] == grid[2][1] && grid[2][1] == grid[2][2])
			ans = true;
		if(ans) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}

} 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();
			}
		}
		for(int i = 1; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				grid[i][j] -= grid[0][j];
			}
		}
		boolean ans = false;
		if(grid[1][0] == grid[1][1] && grid[1][1] == grid[1][2] && grid[2][0] == grid[2][1] && grid[2][1] == grid[2][2])
			ans = true;
		if(ans) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}

} 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();
			}
		}
		for(int i = 1; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				grid[i][j] -= grid[0][j];
			}
		}
		boolean ans = false;
		if(grid[1][0] == grid[1][1] && grid[1][1] == grid[1][2] && grid[2][0] == grid[2][1] && grid[2][1] == grid[2][2])
			ans = true;
		if(ans) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	} 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();
			}
		}
		for(int i = 1; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				grid[i][j] -= grid[0][j];
			}
		}
		boolean ans = false;
		if(grid[1][0] == grid[1][1] && grid[1][1] == grid[1][2] && grid[2][0] == grid[2][1] && grid[2][1] == grid[2][2])
			ans = true;
		if(ans) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	} 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 for(int i = 1; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				grid[i][j] -= grid[0][j];
			}
		} int i = 1; int i = 1; i 1 i < 3 i 3 i++ i++ i {
			for(int j = 0; j < 3; j++) {
				grid[i][j] -= grid[0][j];
			}
		} {
			for(int j = 0; j < 3; j++) {
				grid[i][j] -= grid[0][j];
			}
		} for(int j = 0; j < 3; j++) {
				grid[i][j] -= grid[0][j];
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				grid[i][j] -= grid[0][j];
			} {
				grid[i][j] -= grid[0][j];
			} grid[i][j] -= grid[0][j] grid[i][j] grid[i] grid i j grid[0][j] grid[0] grid 0 j boolean ans = false; ans false if(grid[1][0] == grid[1][1] && grid[1][1] == grid[1][2] && grid[2][0] == grid[2][1] && grid[2][1] == grid[2][2])
			ans = true; grid[1][0] == grid[1][1] && grid[1][1] == grid[1][2] && grid[2][0] == grid[2][1] && grid[2][1] == grid[2][2] grid[2][0] == grid[2][1] grid[1][0] == grid[1][1] && grid[1][1] == grid[1][2] && grid[2][0] == grid[2][1] && grid[2][1] == grid[2][2] grid[1][0] == grid[1][1] grid[1][0] grid[1] grid 1 0 grid[1][1] grid[1] grid 1 1 grid[1][1] == grid[1][2] grid[1][1] grid[1] grid 1 1 grid[1][2] grid[1] grid 1 2 grid[2][0] == grid[2][1] grid[2][0] grid[2] grid 2 0 grid[2][1] grid[2] grid 2 1 grid[2][1] == grid[2][2] grid[2][1] grid[2] grid 2 1 grid[2][2] grid[2] grid 2 2 ans = true ans true if(ans) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		} ans {
			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[][] grid = new int[3][3];
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				grid[i][j] = sc.nextInt();
			}
		}
		for(int i = 1; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				grid[i][j] -= grid[0][j];
			}
		}
		boolean ans = false;
		if(grid[1][0] == grid[1][1] && grid[1][1] == grid[1][2] && grid[2][0] == grid[2][1] && grid[2][1] == grid[2][2])
			ans = true;
		if(ans) {
			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[][] grid = new int[3][3];
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				grid[i][j] = sc.nextInt();
			}
		}
		for(int i = 1; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				grid[i][j] -= grid[0][j];
			}
		}
		boolean ans = false;
		if(grid[1][0] == grid[1][1] && grid[1][1] == grid[1][2] && grid[2][0] == grid[2][1] && grid[2][1] == grid[2][2])
			ans = true;
		if(ans) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}

} 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();
			}
		}
		for(int i = 1; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				grid[i][j] -= grid[0][j];
			}
		}
		boolean ans = false;
		if(grid[1][0] == grid[1][1] && grid[1][1] == grid[1][2] && grid[2][0] == grid[2][1] && grid[2][1] == grid[2][2])
			ans = true;
		if(ans) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}

}
