import java.util.Scanner;

class Point{
	int x;
	int y;
	int z;
	Point(int a,int b,int c){
		this.x = a;
		this.y = b;
		this.z = c;
	}
}
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();
			}
		}
		sc.close();

		int[][] V = new int[3][3];
		V[0][0] = 0;
		V[1][0] = 0;
		V[2][0] = 0;

		for(int i = 0 ; i < 3 ; i++){
			for(int j = 0 ; j < 3 ; j++){
				if(j>0){
					V[i][j] = C[i][j]-C[i][j-1];
				}
			}
		}
/*
		for(int i = 0 ; i < 3 ; i++){
			for(int j = 0 ; j < 3 ; j++){
			System.out.print(V[i][j] + " ");
			}
			System.out.println("");
		}
*/

		if(V[0][0] == V[1][0] && V[1][0] == V[2][0]){
			if(V[0][1] == V[1][1] && V[1][1] == V[2][1]){
				if(V[0][2] == V[1][2] && V[1][2] == V[2][2]){
					System.out.println("Yes");
				}
				else{
					System.out.println("No");
				}
			}
			else{
				System.out.println("No");
			}
		}
		else{
			System.out.println("No");
		}
	}
} import java.util.Scanner; Scanner java.util class Point{
	int x;
	int y;
	int z;
	Point(int a,int b,int c){
		this.x = a;
		this.y = b;
		this.z = c;
	}
} Point int x; x int y; y int z; z Point(int a,int b,int c){
		this.x = a;
		this.y = b;
		this.z = c;
	} Point {
		this.x = a;
		this.y = b;
		this.z = c;
	} this.x = a this.x this this.x a this.y = b this.y this this.y b this.z = c this.z this this.z c int a a int b b int c c 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();
			}
		}
		sc.close();

		int[][] V = new int[3][3];
		V[0][0] = 0;
		V[1][0] = 0;
		V[2][0] = 0;

		for(int i = 0 ; i < 3 ; i++){
			for(int j = 0 ; j < 3 ; j++){
				if(j>0){
					V[i][j] = C[i][j]-C[i][j-1];
				}
			}
		}
/*
		for(int i = 0 ; i < 3 ; i++){
			for(int j = 0 ; j < 3 ; j++){
			System.out.print(V[i][j] + " ");
			}
			System.out.println("");
		}
*/

		if(V[0][0] == V[1][0] && V[1][0] == V[2][0]){
			if(V[0][1] == V[1][1] && V[1][1] == V[2][1]){
				if(V[0][2] == V[1][2] && V[1][2] == V[2][2]){
					System.out.println("Yes");
				}
				else{
					System.out.println("No");
				}
			}
			else{
				System.out.println("No");
			}
		}
		else{
			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();
			}
		}
		sc.close();

		int[][] V = new int[3][3];
		V[0][0] = 0;
		V[1][0] = 0;
		V[2][0] = 0;

		for(int i = 0 ; i < 3 ; i++){
			for(int j = 0 ; j < 3 ; j++){
				if(j>0){
					V[i][j] = C[i][j]-C[i][j-1];
				}
			}
		}
/*
		for(int i = 0 ; i < 3 ; i++){
			for(int j = 0 ; j < 3 ; j++){
			System.out.print(V[i][j] + " ");
			}
			System.out.println("");
		}
*/

		if(V[0][0] == V[1][0] && V[1][0] == V[2][0]){
			if(V[0][1] == V[1][1] && V[1][1] == V[2][1]){
				if(V[0][2] == V[1][2] && V[1][2] == V[2][2]){
					System.out.println("Yes");
				}
				else{
					System.out.println("No");
				}
			}
			else{
				System.out.println("No");
			}
		}
		else{
			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();
			}
		}
		sc.close();

		int[][] V = new int[3][3];
		V[0][0] = 0;
		V[1][0] = 0;
		V[2][0] = 0;

		for(int i = 0 ; i < 3 ; i++){
			for(int j = 0 ; j < 3 ; j++){
				if(j>0){
					V[i][j] = C[i][j]-C[i][j-1];
				}
			}
		}
/*
		for(int i = 0 ; i < 3 ; i++){
			for(int j = 0 ; j < 3 ; j++){
			System.out.print(V[i][j] + " ");
			}
			System.out.println("");
		}
*/

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

		int[][] V = new int[3][3];
		V[0][0] = 0;
		V[1][0] = 0;
		V[2][0] = 0;

		for(int i = 0 ; i < 3 ; i++){
			for(int j = 0 ; j < 3 ; j++){
				if(j>0){
					V[i][j] = C[i][j]-C[i][j-1];
				}
			}
		}
/*
		for(int i = 0 ; i < 3 ; i++){
			for(int j = 0 ; j < 3 ; j++){
			System.out.print(V[i][j] + " ");
			}
			System.out.println("");
		}
*/

		if(V[0][0] == V[1][0] && V[1][0] == V[2][0]){
			if(V[0][1] == V[1][1] && V[1][1] == V[2][1]){
				if(V[0][2] == V[1][2] && V[1][2] == V[2][2]){
					System.out.println("Yes");
				}
				else{
					System.out.println("No");
				}
			}
			else{
				System.out.println("No");
			}
		}
		else{
			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();
			}
		}
		sc.close();

		int[][] V = new int[3][3];
		V[0][0] = 0;
		V[1][0] = 0;
		V[2][0] = 0;

		for(int i = 0 ; i < 3 ; i++){
			for(int j = 0 ; j < 3 ; j++){
				if(j>0){
					V[i][j] = C[i][j]-C[i][j-1];
				}
			}
		}
/*
		for(int i = 0 ; i < 3 ; i++){
			for(int j = 0 ; j < 3 ; j++){
			System.out.print(V[i][j] + " ");
			}
			System.out.println("");
		}
*/

		if(V[0][0] == V[1][0] && V[1][0] == V[2][0]){
			if(V[0][1] == V[1][1] && V[1][1] == V[2][1]){
				if(V[0][2] == V[1][2] && V[1][2] == V[2][2]){
					System.out.println("Yes");
				}
				else{
					System.out.println("No");
				}
			}
			else{
				System.out.println("No");
			}
		}
		else{
			System.out.println("No");
		}
	}
} Main
import java.util.Scanner;

class Point{
	int x;
	int y;
	int z;
	Point(int a,int b,int c){
		this.x = a;
		this.y = b;
		this.z = c;
	}
}
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();
			}
		}
		sc.close();

		int[][] V = new int[3][3];
		V[0][0] = 0;
		V[1][0] = 0;
		V[2][0] = 0;

		for(int i = 0 ; i < 3 ; i++){
			for(int j = 0 ; j < 3 ; j++){
				if(j>0){
					V[i][j] = C[i][j]-C[i][j-1];
				}
			}
		}
/*
		for(int i = 0 ; i < 3 ; i++){
			for(int j = 0 ; j < 3 ; j++){
			System.out.print(V[i][j] + " ");
			}
			System.out.println("");
		}
*/

		if(V[0][0] == V[1][0] && V[1][0] == V[2][0]){
			if(V[0][1] == V[1][1] && V[1][1] == V[2][1]){
				if(V[0][2] == V[1][2] && V[1][2] == V[2][2]){
					System.out.println("Yes");
				}
				else{
					System.out.println("No");
				}
			}
			else{
				System.out.println("No");
			}
		}
		else{
			System.out.println("No");
		}
	}
}