import java.util.*;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int[][] ab = new int[3][3];
		
		ab[0][0] = sc.nextInt();
		ab[0][1] = sc.nextInt();
		ab[0][2] = sc.nextInt();
		ab[1][0] = sc.nextInt();
		ab[1][1] = sc.nextInt();
		ab[1][2] = sc.nextInt();
		ab[2][0] = sc.nextInt();
		ab[2][1] = sc.nextInt();
		ab[2][2] = sc.nextInt();
		

		if(diff_check(ab,0,1,true)&&
				diff_check(ab,0,2,true)&&
				diff_check(ab,1,2,true)&&
				diff_check(ab,0,1,false)&&
				diff_check(ab,0,2,false)&&
				diff_check(ab,1,2,false))
		System.out.println( "Yes");
		else
			System.out.println( "No");
	}

	private static boolean diff_check(int[][] ab, int i, int j, boolean b) {
		
		int point;
		
		if(b){
			point = ab[i][0]-ab[j][0];
			if(point!=ab[i][1]-ab[j][1])	return false;
			if(point!=ab[i][2]-ab[j][2])	return false;
		}else{
			point = ab[0][i]-ab[0][j];
			if(point!=ab[1][i]-ab[1][j])	return false;
			if(point!=ab[2][i]-ab[2][j])	return false;
		}
		
		return true;
		
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int[][] ab = new int[3][3];
		
		ab[0][0] = sc.nextInt();
		ab[0][1] = sc.nextInt();
		ab[0][2] = sc.nextInt();
		ab[1][0] = sc.nextInt();
		ab[1][1] = sc.nextInt();
		ab[1][2] = sc.nextInt();
		ab[2][0] = sc.nextInt();
		ab[2][1] = sc.nextInt();
		ab[2][2] = sc.nextInt();
		

		if(diff_check(ab,0,1,true)&&
				diff_check(ab,0,2,true)&&
				diff_check(ab,1,2,true)&&
				diff_check(ab,0,1,false)&&
				diff_check(ab,0,2,false)&&
				diff_check(ab,1,2,false))
		System.out.println( "Yes");
		else
			System.out.println( "No");
	}

	private static boolean diff_check(int[][] ab, int i, int j, boolean b) {
		
		int point;
		
		if(b){
			point = ab[i][0]-ab[j][0];
			if(point!=ab[i][1]-ab[j][1])	return false;
			if(point!=ab[i][2]-ab[j][2])	return false;
		}else{
			point = ab[0][i]-ab[0][j];
			if(point!=ab[1][i]-ab[1][j])	return false;
			if(point!=ab[2][i]-ab[2][j])	return false;
		}
		
		return true;
		
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int[][] ab = new int[3][3];
		
		ab[0][0] = sc.nextInt();
		ab[0][1] = sc.nextInt();
		ab[0][2] = sc.nextInt();
		ab[1][0] = sc.nextInt();
		ab[1][1] = sc.nextInt();
		ab[1][2] = sc.nextInt();
		ab[2][0] = sc.nextInt();
		ab[2][1] = sc.nextInt();
		ab[2][2] = sc.nextInt();
		

		if(diff_check(ab,0,1,true)&&
				diff_check(ab,0,2,true)&&
				diff_check(ab,1,2,true)&&
				diff_check(ab,0,1,false)&&
				diff_check(ab,0,2,false)&&
				diff_check(ab,1,2,false))
		System.out.println( "Yes");
		else
			System.out.println( "No");
	} main {
		Scanner sc = new Scanner(System.in);
		
		int[][] ab = new int[3][3];
		
		ab[0][0] = sc.nextInt();
		ab[0][1] = sc.nextInt();
		ab[0][2] = sc.nextInt();
		ab[1][0] = sc.nextInt();
		ab[1][1] = sc.nextInt();
		ab[1][2] = sc.nextInt();
		ab[2][0] = sc.nextInt();
		ab[2][1] = sc.nextInt();
		ab[2][2] = sc.nextInt();
		

		if(diff_check(ab,0,1,true)&&
				diff_check(ab,0,2,true)&&
				diff_check(ab,1,2,true)&&
				diff_check(ab,0,1,false)&&
				diff_check(ab,0,2,false)&&
				diff_check(ab,1,2,false))
		System.out.println( "Yes");
		else
			System.out.println( "No");
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[][] ab = new int[3][3]; ab new int[3][3] 3 3 ab[0][0] = sc.nextInt() ab[0][0] ab[0] ab 0 0 sc.nextInt() sc.nextInt sc ab[0][1] = sc.nextInt() ab[0][1] ab[0] ab 0 1 sc.nextInt() sc.nextInt sc ab[0][2] = sc.nextInt() ab[0][2] ab[0] ab 0 2 sc.nextInt() sc.nextInt sc ab[1][0] = sc.nextInt() ab[1][0] ab[1] ab 1 0 sc.nextInt() sc.nextInt sc ab[1][1] = sc.nextInt() ab[1][1] ab[1] ab 1 1 sc.nextInt() sc.nextInt sc ab[1][2] = sc.nextInt() ab[1][2] ab[1] ab 1 2 sc.nextInt() sc.nextInt sc ab[2][0] = sc.nextInt() ab[2][0] ab[2] ab 2 0 sc.nextInt() sc.nextInt sc ab[2][1] = sc.nextInt() ab[2][1] ab[2] ab 2 1 sc.nextInt() sc.nextInt sc ab[2][2] = sc.nextInt() ab[2][2] ab[2] ab 2 2 sc.nextInt() sc.nextInt sc if(diff_check(ab,0,1,true)&&
				diff_check(ab,0,2,true)&&
				diff_check(ab,1,2,true)&&
				diff_check(ab,0,1,false)&&
				diff_check(ab,0,2,false)&&
				diff_check(ab,1,2,false))
		System.out.println( "Yes");
		else
			System.out.println( "No"); diff_check(ab,0,1,true)&&
				diff_check(ab,0,2,true)&&
				diff_check(ab,1,2,true)&&
				diff_check(ab,0,1,false)&&
				diff_check(ab,0,2,false)&&
				diff_check(ab,1,2,false) diff_check(ab,0,2,false) diff_check(ab,0,1,false) diff_check(ab,1,2,true) diff_check(ab,0,1,true)&&
				diff_check(ab,0,2,true)&&
				diff_check(ab,1,2,true)&&
				diff_check(ab,0,1,false)&&
				diff_check(ab,0,2,false)&&
				diff_check(ab,1,2,false) diff_check(ab,0,1,true) diff_check ab 0 1 true diff_check(ab,0,2,true) diff_check ab 0 2 true diff_check(ab,1,2,true) diff_check ab 1 2 true diff_check(ab,0,1,false) diff_check ab 0 1 false diff_check(ab,0,2,false) diff_check ab 0 2 false diff_check(ab,1,2,false) diff_check ab 1 2 false 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" String[] args args private static boolean diff_check(int[][] ab, int i, int j, boolean b) {
		
		int point;
		
		if(b){
			point = ab[i][0]-ab[j][0];
			if(point!=ab[i][1]-ab[j][1])	return false;
			if(point!=ab[i][2]-ab[j][2])	return false;
		}else{
			point = ab[0][i]-ab[0][j];
			if(point!=ab[1][i]-ab[1][j])	return false;
			if(point!=ab[2][i]-ab[2][j])	return false;
		}
		
		return true;
		
	} diff_check {
		
		int point;
		
		if(b){
			point = ab[i][0]-ab[j][0];
			if(point!=ab[i][1]-ab[j][1])	return false;
			if(point!=ab[i][2]-ab[j][2])	return false;
		}else{
			point = ab[0][i]-ab[0][j];
			if(point!=ab[1][i]-ab[1][j])	return false;
			if(point!=ab[2][i]-ab[2][j])	return false;
		}
		
		return true;
		
	} int point; point if(b){
			point = ab[i][0]-ab[j][0];
			if(point!=ab[i][1]-ab[j][1])	return false;
			if(point!=ab[i][2]-ab[j][2])	return false;
		}else{
			point = ab[0][i]-ab[0][j];
			if(point!=ab[1][i]-ab[1][j])	return false;
			if(point!=ab[2][i]-ab[2][j])	return false;
		} b {
			point = ab[i][0]-ab[j][0];
			if(point!=ab[i][1]-ab[j][1])	return false;
			if(point!=ab[i][2]-ab[j][2])	return false;
		} point = ab[i][0]-ab[j][0] point ab[i][0]-ab[j][0] ab[i][0] ab[i] ab i 0 ab[j][0] ab[j] ab j 0 if(point!=ab[i][1]-ab[j][1])	return false; point!=ab[i][1]-ab[j][1] point ab[i][1]-ab[j][1] ab[i][1] ab[i] ab i 1 ab[j][1] ab[j] ab j 1 return false; false if(point!=ab[i][2]-ab[j][2])	return false; point!=ab[i][2]-ab[j][2] point ab[i][2]-ab[j][2] ab[i][2] ab[i] ab i 2 ab[j][2] ab[j] ab j 2 return false; false {
			point = ab[0][i]-ab[0][j];
			if(point!=ab[1][i]-ab[1][j])	return false;
			if(point!=ab[2][i]-ab[2][j])	return false;
		} point = ab[0][i]-ab[0][j] point ab[0][i]-ab[0][j] ab[0][i] ab[0] ab 0 i ab[0][j] ab[0] ab 0 j if(point!=ab[1][i]-ab[1][j])	return false; point!=ab[1][i]-ab[1][j] point ab[1][i]-ab[1][j] ab[1][i] ab[1] ab 1 i ab[1][j] ab[1] ab 1 j return false; false if(point!=ab[2][i]-ab[2][j])	return false; point!=ab[2][i]-ab[2][j] point ab[2][i]-ab[2][j] ab[2][i] ab[2] ab 2 i ab[2][j] ab[2] ab 2 j return false; false return true; true int[][] ab ab int i i int j j boolean b b public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int[][] ab = new int[3][3];
		
		ab[0][0] = sc.nextInt();
		ab[0][1] = sc.nextInt();
		ab[0][2] = sc.nextInt();
		ab[1][0] = sc.nextInt();
		ab[1][1] = sc.nextInt();
		ab[1][2] = sc.nextInt();
		ab[2][0] = sc.nextInt();
		ab[2][1] = sc.nextInt();
		ab[2][2] = sc.nextInt();
		

		if(diff_check(ab,0,1,true)&&
				diff_check(ab,0,2,true)&&
				diff_check(ab,1,2,true)&&
				diff_check(ab,0,1,false)&&
				diff_check(ab,0,2,false)&&
				diff_check(ab,1,2,false))
		System.out.println( "Yes");
		else
			System.out.println( "No");
	}

	private static boolean diff_check(int[][] ab, int i, int j, boolean b) {
		
		int point;
		
		if(b){
			point = ab[i][0]-ab[j][0];
			if(point!=ab[i][1]-ab[j][1])	return false;
			if(point!=ab[i][2]-ab[j][2])	return false;
		}else{
			point = ab[0][i]-ab[0][j];
			if(point!=ab[1][i]-ab[1][j])	return false;
			if(point!=ab[2][i]-ab[2][j])	return false;
		}
		
		return true;
		
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int[][] ab = new int[3][3];
		
		ab[0][0] = sc.nextInt();
		ab[0][1] = sc.nextInt();
		ab[0][2] = sc.nextInt();
		ab[1][0] = sc.nextInt();
		ab[1][1] = sc.nextInt();
		ab[1][2] = sc.nextInt();
		ab[2][0] = sc.nextInt();
		ab[2][1] = sc.nextInt();
		ab[2][2] = sc.nextInt();
		

		if(diff_check(ab,0,1,true)&&
				diff_check(ab,0,2,true)&&
				diff_check(ab,1,2,true)&&
				diff_check(ab,0,1,false)&&
				diff_check(ab,0,2,false)&&
				diff_check(ab,1,2,false))
		System.out.println( "Yes");
		else
			System.out.println( "No");
	}

	private static boolean diff_check(int[][] ab, int i, int j, boolean b) {
		
		int point;
		
		if(b){
			point = ab[i][0]-ab[j][0];
			if(point!=ab[i][1]-ab[j][1])	return false;
			if(point!=ab[i][2]-ab[j][2])	return false;
		}else{
			point = ab[0][i]-ab[0][j];
			if(point!=ab[1][i]-ab[1][j])	return false;
			if(point!=ab[2][i]-ab[2][j])	return false;
		}
		
		return true;
		
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int[][] ab = new int[3][3];
		
		ab[0][0] = sc.nextInt();
		ab[0][1] = sc.nextInt();
		ab[0][2] = sc.nextInt();
		ab[1][0] = sc.nextInt();
		ab[1][1] = sc.nextInt();
		ab[1][2] = sc.nextInt();
		ab[2][0] = sc.nextInt();
		ab[2][1] = sc.nextInt();
		ab[2][2] = sc.nextInt();
		

		if(diff_check(ab,0,1,true)&&
				diff_check(ab,0,2,true)&&
				diff_check(ab,1,2,true)&&
				diff_check(ab,0,1,false)&&
				diff_check(ab,0,2,false)&&
				diff_check(ab,1,2,false))
		System.out.println( "Yes");
		else
			System.out.println( "No");
	}

	private static boolean diff_check(int[][] ab, int i, int j, boolean b) {
		
		int point;
		
		if(b){
			point = ab[i][0]-ab[j][0];
			if(point!=ab[i][1]-ab[j][1])	return false;
			if(point!=ab[i][2]-ab[j][2])	return false;
		}else{
			point = ab[0][i]-ab[0][j];
			if(point!=ab[1][i]-ab[1][j])	return false;
			if(point!=ab[2][i]-ab[2][j])	return false;
		}
		
		return true;
		
	}
}