import java.util.*;
import java.lang.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		int[][] cc = new int[4][4];
		for( int i=1; i<=3; i++ ){
			for( int k=1; k<=3; k++ ){
				cc[i][k] = sc.nextInt();
			}
		}
		loop:for( int i=0; i<=100; i++ ){
			for( int j=0; j<=100; j++ ){
				for( int k=0; k<=100; k++ ){
					int a = cc[1][1]-i;
					int b = cc[1][2]-i;
					int c = cc[1][3]-i;
					int d = cc[2][1]-j;
					int e = cc[2][2]-j;
					int f = cc[2][3]-j;
					int g = cc[3][1]-k;
					int h = cc[3][2]-k;
					int l = cc[3][3]-k;
					if( a==d && d==g && b==e && e==h && c==f && f==l ){
						System.out.println("Yes");
						break loop;
					}
				}
			}
			if( i==100 ){
				System.out.println("No");
				break;
			}
		}
	}
} import java.util.*; util.* java import java.lang.*; lang.* java public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		int[][] cc = new int[4][4];
		for( int i=1; i<=3; i++ ){
			for( int k=1; k<=3; k++ ){
				cc[i][k] = sc.nextInt();
			}
		}
		loop:for( int i=0; i<=100; i++ ){
			for( int j=0; j<=100; j++ ){
				for( int k=0; k<=100; k++ ){
					int a = cc[1][1]-i;
					int b = cc[1][2]-i;
					int c = cc[1][3]-i;
					int d = cc[2][1]-j;
					int e = cc[2][2]-j;
					int f = cc[2][3]-j;
					int g = cc[3][1]-k;
					int h = cc[3][2]-k;
					int l = cc[3][3]-k;
					if( a==d && d==g && b==e && e==h && c==f && f==l ){
						System.out.println("Yes");
						break loop;
					}
				}
			}
			if( i==100 ){
				System.out.println("No");
				break;
			}
		}
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		int[][] cc = new int[4][4];
		for( int i=1; i<=3; i++ ){
			for( int k=1; k<=3; k++ ){
				cc[i][k] = sc.nextInt();
			}
		}
		loop:for( int i=0; i<=100; i++ ){
			for( int j=0; j<=100; j++ ){
				for( int k=0; k<=100; k++ ){
					int a = cc[1][1]-i;
					int b = cc[1][2]-i;
					int c = cc[1][3]-i;
					int d = cc[2][1]-j;
					int e = cc[2][2]-j;
					int f = cc[2][3]-j;
					int g = cc[3][1]-k;
					int h = cc[3][2]-k;
					int l = cc[3][3]-k;
					if( a==d && d==g && b==e && e==h && c==f && f==l ){
						System.out.println("Yes");
						break loop;
					}
				}
			}
			if( i==100 ){
				System.out.println("No");
				break;
			}
		}
	} main {
		Scanner sc = new Scanner(System.in);

		int[][] cc = new int[4][4];
		for( int i=1; i<=3; i++ ){
			for( int k=1; k<=3; k++ ){
				cc[i][k] = sc.nextInt();
			}
		}
		loop:for( int i=0; i<=100; i++ ){
			for( int j=0; j<=100; j++ ){
				for( int k=0; k<=100; k++ ){
					int a = cc[1][1]-i;
					int b = cc[1][2]-i;
					int c = cc[1][3]-i;
					int d = cc[2][1]-j;
					int e = cc[2][2]-j;
					int f = cc[2][3]-j;
					int g = cc[3][1]-k;
					int h = cc[3][2]-k;
					int l = cc[3][3]-k;
					if( a==d && d==g && b==e && e==h && c==f && f==l ){
						System.out.println("Yes");
						break loop;
					}
				}
			}
			if( i==100 ){
				System.out.println("No");
				break;
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[][] cc = new int[4][4]; cc new int[4][4] 4 4 for( int i=1; i<=3; i++ ){
			for( int k=1; k<=3; k++ ){
				cc[i][k] = sc.nextInt();
			}
		} int i=1; int i=1; i 1 i<=3 i 3 i++ i++ i {
			for( int k=1; k<=3; k++ ){
				cc[i][k] = sc.nextInt();
			}
		} {
			for( int k=1; k<=3; k++ ){
				cc[i][k] = sc.nextInt();
			}
		} for( int k=1; k<=3; k++ ){
				cc[i][k] = sc.nextInt();
			} int k=1; int k=1; k 1 k<=3 k 3 k++ k++ k {
				cc[i][k] = sc.nextInt();
			} {
				cc[i][k] = sc.nextInt();
			} cc[i][k] = sc.nextInt() cc[i][k] cc[i] cc i k sc.nextInt() sc.nextInt sc String[] args args public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		int[][] cc = new int[4][4];
		for( int i=1; i<=3; i++ ){
			for( int k=1; k<=3; k++ ){
				cc[i][k] = sc.nextInt();
			}
		}
		loop:for( int i=0; i<=100; i++ ){
			for( int j=0; j<=100; j++ ){
				for( int k=0; k<=100; k++ ){
					int a = cc[1][1]-i;
					int b = cc[1][2]-i;
					int c = cc[1][3]-i;
					int d = cc[2][1]-j;
					int e = cc[2][2]-j;
					int f = cc[2][3]-j;
					int g = cc[3][1]-k;
					int h = cc[3][2]-k;
					int l = cc[3][3]-k;
					if( a==d && d==g && b==e && e==h && c==f && f==l ){
						System.out.println("Yes");
						break loop;
					}
				}
			}
			if( i==100 ){
				System.out.println("No");
				break;
			}
		}
	}
} public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		int[][] cc = new int[4][4];
		for( int i=1; i<=3; i++ ){
			for( int k=1; k<=3; k++ ){
				cc[i][k] = sc.nextInt();
			}
		}
		loop:for( int i=0; i<=100; i++ ){
			for( int j=0; j<=100; j++ ){
				for( int k=0; k<=100; k++ ){
					int a = cc[1][1]-i;
					int b = cc[1][2]-i;
					int c = cc[1][3]-i;
					int d = cc[2][1]-j;
					int e = cc[2][2]-j;
					int f = cc[2][3]-j;
					int g = cc[3][1]-k;
					int h = cc[3][2]-k;
					int l = cc[3][3]-k;
					if( a==d && d==g && b==e && e==h && c==f && f==l ){
						System.out.println("Yes");
						break loop;
					}
				}
			}
			if( i==100 ){
				System.out.println("No");
				break;
			}
		}
	}
} Main
import java.util.*;
import java.lang.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		int[][] cc = new int[4][4];
		for( int i=1; i<=3; i++ ){
			for( int k=1; k<=3; k++ ){
				cc[i][k] = sc.nextInt();
			}
		}
		loop:for( int i=0; i<=100; i++ ){
			for( int j=0; j<=100; j++ ){
				for( int k=0; k<=100; k++ ){
					int a = cc[1][1]-i;
					int b = cc[1][2]-i;
					int c = cc[1][3]-i;
					int d = cc[2][1]-j;
					int e = cc[2][2]-j;
					int f = cc[2][3]-j;
					int g = cc[3][1]-k;
					int h = cc[3][2]-k;
					int l = cc[3][3]-k;
					if( a==d && d==g && b==e && e==h && c==f && f==l ){
						System.out.println("Yes");
						break loop;
					}
				}
			}
			if( i==100 ){
				System.out.println("No");
				break;
			}
		}
	}
}
