import java.util.*;
public class Main {
	
	public static void main(String[] args) {
		Scanner stdIn = 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] = stdIn.nextInt();
			}
		}
		
		/*
		int s1 = c[0][0]-c[1][0];
		int s2 = c[0][1]-c[1][1];
		int s3 = c[0][2]-c[1][2];
		
		int s4 = c[1][0]-c[2][0];
		int s5 = c[1][1]-c[2][1];
		int s6 = c[1][2]-c[2][2];
		
		int s7 = c[0][0]-c[0][1];
		int s8 = c[1][0]-c[1][1];
		int s9 = c[2][0]-c[2][1];
		
		int s10 = c[0][1]-c[0][2];
		int s11 = c[1][1]-c[1][2];
		int s12 = c[2][1]-c[2][2];
		
		if(s1 == s2 && s2 == s3 && s4 == s5 && s5 == s6 && s7 == s8 && s8 == s9 && s10 == s11 && s11 == s12) {
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
		*/
		
		int[] a = new int[3];
		int[] b = new int[3];
		a[0] = 0;
		b[0] = c[0][0];
		b[1] = c[0][1];
		b[2] = c[0][2];
		a[1] = c[1][0]-b[0];
		a[2] = c[2][0]-b[0];
		
		boolean flag = true;
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				if(c[i][j] != a[i] + b[j]) {
					flag = false;
					break;
				}
			}
		}
		
		if(flag) {
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
	}

} import java.util.*; util.* java public class Main {
	
	public static void main(String[] args) {
		Scanner stdIn = 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] = stdIn.nextInt();
			}
		}
		
		/*
		int s1 = c[0][0]-c[1][0];
		int s2 = c[0][1]-c[1][1];
		int s3 = c[0][2]-c[1][2];
		
		int s4 = c[1][0]-c[2][0];
		int s5 = c[1][1]-c[2][1];
		int s6 = c[1][2]-c[2][2];
		
		int s7 = c[0][0]-c[0][1];
		int s8 = c[1][0]-c[1][1];
		int s9 = c[2][0]-c[2][1];
		
		int s10 = c[0][1]-c[0][2];
		int s11 = c[1][1]-c[1][2];
		int s12 = c[2][1]-c[2][2];
		
		if(s1 == s2 && s2 == s3 && s4 == s5 && s5 == s6 && s7 == s8 && s8 == s9 && s10 == s11 && s11 == s12) {
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
		*/
		
		int[] a = new int[3];
		int[] b = new int[3];
		a[0] = 0;
		b[0] = c[0][0];
		b[1] = c[0][1];
		b[2] = c[0][2];
		a[1] = c[1][0]-b[0];
		a[2] = c[2][0]-b[0];
		
		boolean flag = true;
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				if(c[i][j] != a[i] + b[j]) {
					flag = false;
					break;
				}
			}
		}
		
		if(flag) {
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
	}

} Main public static void main(String[] args) {
		Scanner stdIn = 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] = stdIn.nextInt();
			}
		}
		
		/*
		int s1 = c[0][0]-c[1][0];
		int s2 = c[0][1]-c[1][1];
		int s3 = c[0][2]-c[1][2];
		
		int s4 = c[1][0]-c[2][0];
		int s5 = c[1][1]-c[2][1];
		int s6 = c[1][2]-c[2][2];
		
		int s7 = c[0][0]-c[0][1];
		int s8 = c[1][0]-c[1][1];
		int s9 = c[2][0]-c[2][1];
		
		int s10 = c[0][1]-c[0][2];
		int s11 = c[1][1]-c[1][2];
		int s12 = c[2][1]-c[2][2];
		
		if(s1 == s2 && s2 == s3 && s4 == s5 && s5 == s6 && s7 == s8 && s8 == s9 && s10 == s11 && s11 == s12) {
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
		*/
		
		int[] a = new int[3];
		int[] b = new int[3];
		a[0] = 0;
		b[0] = c[0][0];
		b[1] = c[0][1];
		b[2] = c[0][2];
		a[1] = c[1][0]-b[0];
		a[2] = c[2][0]-b[0];
		
		boolean flag = true;
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				if(c[i][j] != a[i] + b[j]) {
					flag = false;
					break;
				}
			}
		}
		
		if(flag) {
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
	} main {
		Scanner stdIn = 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] = stdIn.nextInt();
			}
		}
		
		/*
		int s1 = c[0][0]-c[1][0];
		int s2 = c[0][1]-c[1][1];
		int s3 = c[0][2]-c[1][2];
		
		int s4 = c[1][0]-c[2][0];
		int s5 = c[1][1]-c[2][1];
		int s6 = c[1][2]-c[2][2];
		
		int s7 = c[0][0]-c[0][1];
		int s8 = c[1][0]-c[1][1];
		int s9 = c[2][0]-c[2][1];
		
		int s10 = c[0][1]-c[0][2];
		int s11 = c[1][1]-c[1][2];
		int s12 = c[2][1]-c[2][2];
		
		if(s1 == s2 && s2 == s3 && s4 == s5 && s5 == s6 && s7 == s8 && s8 == s9 && s10 == s11 && s11 == s12) {
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
		*/
		
		int[] a = new int[3];
		int[] b = new int[3];
		a[0] = 0;
		b[0] = c[0][0];
		b[1] = c[0][1];
		b[2] = c[0][2];
		a[1] = c[1][0]-b[0];
		a[2] = c[2][0]-b[0];
		
		boolean flag = true;
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				if(c[i][j] != a[i] + b[j]) {
					flag = false;
					break;
				}
			}
		}
		
		if(flag) {
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
	} Scanner stdIn = new Scanner(System.in); stdIn 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] = stdIn.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] = stdIn.nextInt();
			}
		} {
			for(int j = 0; j < 3; j++) {
				c[i][j] = stdIn.nextInt();
			}
		} for(int j = 0; j < 3; j++) {
				c[i][j] = stdIn.nextInt();
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				c[i][j] = stdIn.nextInt();
			} {
				c[i][j] = stdIn.nextInt();
			} c[i][j] = stdIn.nextInt() c[i][j] c[i] c i j stdIn.nextInt() stdIn.nextInt stdIn int[] a = new int[3]; a new int[3] 3 int[] b = new int[3]; b new int[3] 3 a[0] = 0 a[0] a 0 0 b[0] = c[0][0] b[0] b 0 c[0][0] c[0] c 0 0 b[1] = c[0][1] b[1] b 1 c[0][1] c[0] c 0 1 b[2] = c[0][2] b[2] b 2 c[0][2] c[0] c 0 2 a[1] = c[1][0]-b[0] a[1] a 1 c[1][0]-b[0] c[1][0] c[1] c 1 0 b[0] b 0 a[2] = c[2][0]-b[0] a[2] a 2 c[2][0]-b[0] c[2][0] c[2] c 2 0 b[0] b 0 boolean flag = true; flag true for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				if(c[i][j] != a[i] + b[j]) {
					flag = false;
					break;
				}
			}
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			for(int j = 0; j < 3; j++) {
				if(c[i][j] != a[i] + b[j]) {
					flag = false;
					break;
				}
			}
		} {
			for(int j = 0; j < 3; j++) {
				if(c[i][j] != a[i] + b[j]) {
					flag = false;
					break;
				}
			}
		} for(int j = 0; j < 3; j++) {
				if(c[i][j] != a[i] + b[j]) {
					flag = false;
					break;
				}
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				if(c[i][j] != a[i] + b[j]) {
					flag = false;
					break;
				}
			} {
				if(c[i][j] != a[i] + b[j]) {
					flag = false;
					break;
				}
			} if(c[i][j] != a[i] + b[j]) {
					flag = false;
					break;
				} c[i][j] != a[i] + b[j] c[i][j] c[i] c i j a[i] + b[j] a[i] a i b[j] b j {
					flag = false;
					break;
				} flag = false flag false break; if(flag) {
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		} flag {
			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 stdIn = 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] = stdIn.nextInt();
			}
		}
		
		/*
		int s1 = c[0][0]-c[1][0];
		int s2 = c[0][1]-c[1][1];
		int s3 = c[0][2]-c[1][2];
		
		int s4 = c[1][0]-c[2][0];
		int s5 = c[1][1]-c[2][1];
		int s6 = c[1][2]-c[2][2];
		
		int s7 = c[0][0]-c[0][1];
		int s8 = c[1][0]-c[1][1];
		int s9 = c[2][0]-c[2][1];
		
		int s10 = c[0][1]-c[0][2];
		int s11 = c[1][1]-c[1][2];
		int s12 = c[2][1]-c[2][2];
		
		if(s1 == s2 && s2 == s3 && s4 == s5 && s5 == s6 && s7 == s8 && s8 == s9 && s10 == s11 && s11 == s12) {
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
		*/
		
		int[] a = new int[3];
		int[] b = new int[3];
		a[0] = 0;
		b[0] = c[0][0];
		b[1] = c[0][1];
		b[2] = c[0][2];
		a[1] = c[1][0]-b[0];
		a[2] = c[2][0]-b[0];
		
		boolean flag = true;
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				if(c[i][j] != a[i] + b[j]) {
					flag = false;
					break;
				}
			}
		}
		
		if(flag) {
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
	}

} public class Main {
	
	public static void main(String[] args) {
		Scanner stdIn = 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] = stdIn.nextInt();
			}
		}
		
		/*
		int s1 = c[0][0]-c[1][0];
		int s2 = c[0][1]-c[1][1];
		int s3 = c[0][2]-c[1][2];
		
		int s4 = c[1][0]-c[2][0];
		int s5 = c[1][1]-c[2][1];
		int s6 = c[1][2]-c[2][2];
		
		int s7 = c[0][0]-c[0][1];
		int s8 = c[1][0]-c[1][1];
		int s9 = c[2][0]-c[2][1];
		
		int s10 = c[0][1]-c[0][2];
		int s11 = c[1][1]-c[1][2];
		int s12 = c[2][1]-c[2][2];
		
		if(s1 == s2 && s2 == s3 && s4 == s5 && s5 == s6 && s7 == s8 && s8 == s9 && s10 == s11 && s11 == s12) {
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
		*/
		
		int[] a = new int[3];
		int[] b = new int[3];
		a[0] = 0;
		b[0] = c[0][0];
		b[1] = c[0][1];
		b[2] = c[0][2];
		a[1] = c[1][0]-b[0];
		a[2] = c[2][0]-b[0];
		
		boolean flag = true;
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				if(c[i][j] != a[i] + b[j]) {
					flag = false;
					break;
				}
			}
		}
		
		if(flag) {
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
	}

} Main
import java.util.*;
public class Main {
	
	public static void main(String[] args) {
		Scanner stdIn = 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] = stdIn.nextInt();
			}
		}
		
		/*
		int s1 = c[0][0]-c[1][0];
		int s2 = c[0][1]-c[1][1];
		int s3 = c[0][2]-c[1][2];
		
		int s4 = c[1][0]-c[2][0];
		int s5 = c[1][1]-c[2][1];
		int s6 = c[1][2]-c[2][2];
		
		int s7 = c[0][0]-c[0][1];
		int s8 = c[1][0]-c[1][1];
		int s9 = c[2][0]-c[2][1];
		
		int s10 = c[0][1]-c[0][2];
		int s11 = c[1][1]-c[1][2];
		int s12 = c[2][1]-c[2][2];
		
		if(s1 == s2 && s2 == s3 && s4 == s5 && s5 == s6 && s7 == s8 && s8 == s9 && s10 == s11 && s11 == s12) {
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
		*/
		
		int[] a = new int[3];
		int[] b = new int[3];
		a[0] = 0;
		b[0] = c[0][0];
		b[1] = c[0][1];
		b[2] = c[0][2];
		a[1] = c[1][0]-b[0];
		a[2] = c[2][0]-b[0];
		
		boolean flag = true;
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				if(c[i][j] != a[i] + b[j]) {
					flag = false;
					break;
				}
			}
		}
		
		if(flag) {
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
	}

}