import java.util.*;

class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int map[][] = new int[3][3];

		for(int h=0;h<3;h++){
			for(int w=0;w<3;w++){
				map[h][w] = sc.nextInt();
			}
		}

		int dw1 = map[0][1]-map[0][0];
		if(dw1 != map[1][1]-map[1][0] || dw1 != map[2][1]-map[2][0]){ answer(false); return;}

		int dw2 = map[0][2]-map[0][1];
		if(dw2 != map[1][2]-map[1][1] || dw2 != map[2][2]-map[2][1]) { answer(false); return;}

		int dh1 = map[1][0]-map[0][0];
		if(dh1 != map[1][1]-map[0][1] || dh1 != map[1][2]-map[0][2]){ answer(false); return;}

		int dh2 = map[2][0]-map[1][0];
		if(dh2 != map[2][1]-map[1][1] || dh2 != map[2][2]-map[1][2]){ answer(false); return;}

		answer(true);
	}

	private static void answer(boolean ans){
		if(ans) System.out.println("Yes");
		else System.out.println("No");
	}
} import java.util.*; util.* java class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int map[][] = new int[3][3];

		for(int h=0;h<3;h++){
			for(int w=0;w<3;w++){
				map[h][w] = sc.nextInt();
			}
		}

		int dw1 = map[0][1]-map[0][0];
		if(dw1 != map[1][1]-map[1][0] || dw1 != map[2][1]-map[2][0]){ answer(false); return;}

		int dw2 = map[0][2]-map[0][1];
		if(dw2 != map[1][2]-map[1][1] || dw2 != map[2][2]-map[2][1]) { answer(false); return;}

		int dh1 = map[1][0]-map[0][0];
		if(dh1 != map[1][1]-map[0][1] || dh1 != map[1][2]-map[0][2]){ answer(false); return;}

		int dh2 = map[2][0]-map[1][0];
		if(dh2 != map[2][1]-map[1][1] || dh2 != map[2][2]-map[1][2]){ answer(false); return;}

		answer(true);
	}

	private static void answer(boolean ans){
		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 map[][] = new int[3][3];

		for(int h=0;h<3;h++){
			for(int w=0;w<3;w++){
				map[h][w] = sc.nextInt();
			}
		}

		int dw1 = map[0][1]-map[0][0];
		if(dw1 != map[1][1]-map[1][0] || dw1 != map[2][1]-map[2][0]){ answer(false); return;}

		int dw2 = map[0][2]-map[0][1];
		if(dw2 != map[1][2]-map[1][1] || dw2 != map[2][2]-map[2][1]) { answer(false); return;}

		int dh1 = map[1][0]-map[0][0];
		if(dh1 != map[1][1]-map[0][1] || dh1 != map[1][2]-map[0][2]){ answer(false); return;}

		int dh2 = map[2][0]-map[1][0];
		if(dh2 != map[2][1]-map[1][1] || dh2 != map[2][2]-map[1][2]){ answer(false); return;}

		answer(true);
	} main {
		Scanner sc = new Scanner(System.in);
		int map[][] = new int[3][3];

		for(int h=0;h<3;h++){
			for(int w=0;w<3;w++){
				map[h][w] = sc.nextInt();
			}
		}

		int dw1 = map[0][1]-map[0][0];
		if(dw1 != map[1][1]-map[1][0] || dw1 != map[2][1]-map[2][0]){ answer(false); return;}

		int dw2 = map[0][2]-map[0][1];
		if(dw2 != map[1][2]-map[1][1] || dw2 != map[2][2]-map[2][1]) { answer(false); return;}

		int dh1 = map[1][0]-map[0][0];
		if(dh1 != map[1][1]-map[0][1] || dh1 != map[1][2]-map[0][2]){ answer(false); return;}

		int dh2 = map[2][0]-map[1][0];
		if(dh2 != map[2][1]-map[1][1] || dh2 != map[2][2]-map[1][2]){ answer(false); return;}

		answer(true);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int map[][] = new int[3][3]; map new int[3][3] 3 3 for(int h=0;h<3;h++){
			for(int w=0;w<3;w++){
				map[h][w] = sc.nextInt();
			}
		} int h=0; int h=0; h 0 h<3 h 3 h++ h++ h {
			for(int w=0;w<3;w++){
				map[h][w] = sc.nextInt();
			}
		} {
			for(int w=0;w<3;w++){
				map[h][w] = sc.nextInt();
			}
		} for(int w=0;w<3;w++){
				map[h][w] = sc.nextInt();
			} int w=0; int w=0; w 0 w<3 w 3 w++ w++ w {
				map[h][w] = sc.nextInt();
			} {
				map[h][w] = sc.nextInt();
			} map[h][w] = sc.nextInt() map[h][w] map[h] map h w sc.nextInt() sc.nextInt sc int dw1 = map[0][1]-map[0][0]; dw1 map[0][1]-map[0][0] map[0][1] map[0] map 0 1 map[0][0] map[0] map 0 0 if(dw1 != map[1][1]-map[1][0] || dw1 != map[2][1]-map[2][0]){ answer(false); return;} dw1 != map[1][1]-map[1][0] || dw1 != map[2][1]-map[2][0] dw1 != map[1][1]-map[1][0] dw1 map[1][1]-map[1][0] map[1][1] map[1] map 1 1 map[1][0] map[1] map 1 0 dw1 != map[2][1]-map[2][0] dw1 map[2][1]-map[2][0] map[2][1] map[2] map 2 1 map[2][0] map[2] map 2 0 { answer(false); return;} answer(false) answer false return; int dw2 = map[0][2]-map[0][1]; dw2 map[0][2]-map[0][1] map[0][2] map[0] map 0 2 map[0][1] map[0] map 0 1 if(dw2 != map[1][2]-map[1][1] || dw2 != map[2][2]-map[2][1]) { answer(false); return;} dw2 != map[1][2]-map[1][1] || dw2 != map[2][2]-map[2][1] dw2 != map[1][2]-map[1][1] dw2 map[1][2]-map[1][1] map[1][2] map[1] map 1 2 map[1][1] map[1] map 1 1 dw2 != map[2][2]-map[2][1] dw2 map[2][2]-map[2][1] map[2][2] map[2] map 2 2 map[2][1] map[2] map 2 1 { answer(false); return;} answer(false) answer false return; int dh1 = map[1][0]-map[0][0]; dh1 map[1][0]-map[0][0] map[1][0] map[1] map 1 0 map[0][0] map[0] map 0 0 if(dh1 != map[1][1]-map[0][1] || dh1 != map[1][2]-map[0][2]){ answer(false); return;} dh1 != map[1][1]-map[0][1] || dh1 != map[1][2]-map[0][2] dh1 != map[1][1]-map[0][1] dh1 map[1][1]-map[0][1] map[1][1] map[1] map 1 1 map[0][1] map[0] map 0 1 dh1 != map[1][2]-map[0][2] dh1 map[1][2]-map[0][2] map[1][2] map[1] map 1 2 map[0][2] map[0] map 0 2 { answer(false); return;} answer(false) answer false return; int dh2 = map[2][0]-map[1][0]; dh2 map[2][0]-map[1][0] map[2][0] map[2] map 2 0 map[1][0] map[1] map 1 0 if(dh2 != map[2][1]-map[1][1] || dh2 != map[2][2]-map[1][2]){ answer(false); return;} dh2 != map[2][1]-map[1][1] || dh2 != map[2][2]-map[1][2] dh2 != map[2][1]-map[1][1] dh2 map[2][1]-map[1][1] map[2][1] map[2] map 2 1 map[1][1] map[1] map 1 1 dh2 != map[2][2]-map[1][2] dh2 map[2][2]-map[1][2] map[2][2] map[2] map 2 2 map[1][2] map[1] map 1 2 { answer(false); return;} answer(false) answer false return; answer(true) answer true String args[] args private static void answer(boolean ans){
		if(ans) System.out.println("Yes");
		else System.out.println("No");
	} answer {
		if(ans) System.out.println("Yes");
		else System.out.println("No");
	} if(ans) System.out.println("Yes");
		else System.out.println("No"); ans System.out.println("Yes") System.out.println System.out System System.out "Yes" System.out.println("No") System.out.println System.out System System.out "No" boolean ans ans
import java.util.*;

class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int map[][] = new int[3][3];

		for(int h=0;h<3;h++){
			for(int w=0;w<3;w++){
				map[h][w] = sc.nextInt();
			}
		}

		int dw1 = map[0][1]-map[0][0];
		if(dw1 != map[1][1]-map[1][0] || dw1 != map[2][1]-map[2][0]){ answer(false); return;}

		int dw2 = map[0][2]-map[0][1];
		if(dw2 != map[1][2]-map[1][1] || dw2 != map[2][2]-map[2][1]) { answer(false); return;}

		int dh1 = map[1][0]-map[0][0];
		if(dh1 != map[1][1]-map[0][1] || dh1 != map[1][2]-map[0][2]){ answer(false); return;}

		int dh2 = map[2][0]-map[1][0];
		if(dh2 != map[2][1]-map[1][1] || dh2 != map[2][2]-map[1][2]){ answer(false); return;}

		answer(true);
	}

	private static void answer(boolean ans){
		if(ans) System.out.println("Yes");
		else System.out.println("No");
	}
}