import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.*;

public class Main {

	public static void main(String[] args) throws IOException {
		MyScanner sc = new MyScanner(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();
		}
		for(int a0=-300; a0<=300; a0++) {
			for(int a1=-300; a1<=300; a1++) {
				for(int a2=-300; a2<=300; a2++) {
					if(c[0][0]-a0==c[1][0]-a1&&c[1][0]-a1==c[2][0]-a2) {
						if(c[0][1]-a0==c[1][1]-a1&&c[1][1]-a1==c[2][1]-a2) {
							if(c[0][2]-a0==c[1][2]-a1&&c[1][2]-a1==c[2][2]-a2) {
								System.out.println("Yes");
								return;
							}
						}
					}
				}
			}
		}
		System.out.println("No");
 	}
	
	static void printArray(int[] a) {
		int n=a.length;
		for(int i=0; i<n; i++) {
			if(i==0) System.out.print(a[i]);
			else System.out.print(" "+a[i]);
		}
		System.out.println();
	}

	static class MyScanner
	{
		BufferedReader br;
		StringTokenizer st;
		public MyScanner(InputStream s) 
		{
			br=new BufferedReader(new InputStreamReader(s));
		}
		public String nextLine() throws IOException
		{
			return br.readLine();
		}
		public String next() throws IOException
		{
			while(st==null || !st.hasMoreTokens())
				st=new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int nextInt() throws IOException
		{
			return Integer.parseInt(next());
			
		}
		public double nextDouble() throws IOException
		{
			return Double.parseDouble(next());
		}
		public boolean ready() throws IOException
		{
			return br.ready();
		}
		public long nextLong() throws IOException
		{
			return Long.parseLong(next());
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.*; util.* java public class Main {

	public static void main(String[] args) throws IOException {
		MyScanner sc = new MyScanner(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();
		}
		for(int a0=-300; a0<=300; a0++) {
			for(int a1=-300; a1<=300; a1++) {
				for(int a2=-300; a2<=300; a2++) {
					if(c[0][0]-a0==c[1][0]-a1&&c[1][0]-a1==c[2][0]-a2) {
						if(c[0][1]-a0==c[1][1]-a1&&c[1][1]-a1==c[2][1]-a2) {
							if(c[0][2]-a0==c[1][2]-a1&&c[1][2]-a1==c[2][2]-a2) {
								System.out.println("Yes");
								return;
							}
						}
					}
				}
			}
		}
		System.out.println("No");
 	}
	
	static void printArray(int[] a) {
		int n=a.length;
		for(int i=0; i<n; i++) {
			if(i==0) System.out.print(a[i]);
			else System.out.print(" "+a[i]);
		}
		System.out.println();
	}

	static class MyScanner
	{
		BufferedReader br;
		StringTokenizer st;
		public MyScanner(InputStream s) 
		{
			br=new BufferedReader(new InputStreamReader(s));
		}
		public String nextLine() throws IOException
		{
			return br.readLine();
		}
		public String next() throws IOException
		{
			while(st==null || !st.hasMoreTokens())
				st=new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int nextInt() throws IOException
		{
			return Integer.parseInt(next());
			
		}
		public double nextDouble() throws IOException
		{
			return Double.parseDouble(next());
		}
		public boolean ready() throws IOException
		{
			return br.ready();
		}
		public long nextLong() throws IOException
		{
			return Long.parseLong(next());
		}
	}
} Main public static void main(String[] args) throws IOException {
		MyScanner sc = new MyScanner(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();
		}
		for(int a0=-300; a0<=300; a0++) {
			for(int a1=-300; a1<=300; a1++) {
				for(int a2=-300; a2<=300; a2++) {
					if(c[0][0]-a0==c[1][0]-a1&&c[1][0]-a1==c[2][0]-a2) {
						if(c[0][1]-a0==c[1][1]-a1&&c[1][1]-a1==c[2][1]-a2) {
							if(c[0][2]-a0==c[1][2]-a1&&c[1][2]-a1==c[2][2]-a2) {
								System.out.println("Yes");
								return;
							}
						}
					}
				}
			}
		}
		System.out.println("No");
 	} main {
		MyScanner sc = new MyScanner(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();
		}
		for(int a0=-300; a0<=300; a0++) {
			for(int a1=-300; a1<=300; a1++) {
				for(int a2=-300; a2<=300; a2++) {
					if(c[0][0]-a0==c[1][0]-a1&&c[1][0]-a1==c[2][0]-a2) {
						if(c[0][1]-a0==c[1][1]-a1&&c[1][1]-a1==c[2][1]-a2) {
							if(c[0][2]-a0==c[1][2]-a1&&c[1][2]-a1==c[2][2]-a2) {
								System.out.println("Yes");
								return;
							}
						}
					}
				}
			}
		}
		System.out.println("No");
 	} MyScanner sc = new MyScanner(System.in); sc new MyScanner(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] c[i] c i j sc.nextInt() sc.nextInt sc for(int a0=-300; a0<=300; a0++) {
			for(int a1=-300; a1<=300; a1++) {
				for(int a2=-300; a2<=300; a2++) {
					if(c[0][0]-a0==c[1][0]-a1&&c[1][0]-a1==c[2][0]-a2) {
						if(c[0][1]-a0==c[1][1]-a1&&c[1][1]-a1==c[2][1]-a2) {
							if(c[0][2]-a0==c[1][2]-a1&&c[1][2]-a1==c[2][2]-a2) {
								System.out.println("Yes");
								return;
							}
						}
					}
				}
			}
		} int a0=-300; int a0=-300; a0 -300 300 a0<=300 a0 300 a0++ a0++ a0 {
			for(int a1=-300; a1<=300; a1++) {
				for(int a2=-300; a2<=300; a2++) {
					if(c[0][0]-a0==c[1][0]-a1&&c[1][0]-a1==c[2][0]-a2) {
						if(c[0][1]-a0==c[1][1]-a1&&c[1][1]-a1==c[2][1]-a2) {
							if(c[0][2]-a0==c[1][2]-a1&&c[1][2]-a1==c[2][2]-a2) {
								System.out.println("Yes");
								return;
							}
						}
					}
				}
			}
		} {
			for(int a1=-300; a1<=300; a1++) {
				for(int a2=-300; a2<=300; a2++) {
					if(c[0][0]-a0==c[1][0]-a1&&c[1][0]-a1==c[2][0]-a2) {
						if(c[0][1]-a0==c[1][1]-a1&&c[1][1]-a1==c[2][1]-a2) {
							if(c[0][2]-a0==c[1][2]-a1&&c[1][2]-a1==c[2][2]-a2) {
								System.out.println("Yes");
								return;
							}
						}
					}
				}
			}
		} for(int a1=-300; a1<=300; a1++) {
				for(int a2=-300; a2<=300; a2++) {
					if(c[0][0]-a0==c[1][0]-a1&&c[1][0]-a1==c[2][0]-a2) {
						if(c[0][1]-a0==c[1][1]-a1&&c[1][1]-a1==c[2][1]-a2) {
							if(c[0][2]-a0==c[1][2]-a1&&c[1][2]-a1==c[2][2]-a2) {
								System.out.println("Yes");
								return;
							}
						}
					}
				}
			} int a1=-300; int a1=-300; a1 -300 300 a1<=300 a1 300 a1++ a1++ a1 {
				for(int a2=-300; a2<=300; a2++) {
					if(c[0][0]-a0==c[1][0]-a1&&c[1][0]-a1==c[2][0]-a2) {
						if(c[0][1]-a0==c[1][1]-a1&&c[1][1]-a1==c[2][1]-a2) {
							if(c[0][2]-a0==c[1][2]-a1&&c[1][2]-a1==c[2][2]-a2) {
								System.out.println("Yes");
								return;
							}
						}
					}
				}
			} {
				for(int a2=-300; a2<=300; a2++) {
					if(c[0][0]-a0==c[1][0]-a1&&c[1][0]-a1==c[2][0]-a2) {
						if(c[0][1]-a0==c[1][1]-a1&&c[1][1]-a1==c[2][1]-a2) {
							if(c[0][2]-a0==c[1][2]-a1&&c[1][2]-a1==c[2][2]-a2) {
								System.out.println("Yes");
								return;
							}
						}
					}
				}
			} for(int a2=-300; a2<=300; a2++) {
					if(c[0][0]-a0==c[1][0]-a1&&c[1][0]-a1==c[2][0]-a2) {
						if(c[0][1]-a0==c[1][1]-a1&&c[1][1]-a1==c[2][1]-a2) {
							if(c[0][2]-a0==c[1][2]-a1&&c[1][2]-a1==c[2][2]-a2) {
								System.out.println("Yes");
								return;
							}
						}
					}
				} int a2=-300; int a2=-300; a2 -300 300 a2<=300 a2 300 a2++ a2++ a2 {
					if(c[0][0]-a0==c[1][0]-a1&&c[1][0]-a1==c[2][0]-a2) {
						if(c[0][1]-a0==c[1][1]-a1&&c[1][1]-a1==c[2][1]-a2) {
							if(c[0][2]-a0==c[1][2]-a1&&c[1][2]-a1==c[2][2]-a2) {
								System.out.println("Yes");
								return;
							}
						}
					}
				} {
					if(c[0][0]-a0==c[1][0]-a1&&c[1][0]-a1==c[2][0]-a2) {
						if(c[0][1]-a0==c[1][1]-a1&&c[1][1]-a1==c[2][1]-a2) {
							if(c[0][2]-a0==c[1][2]-a1&&c[1][2]-a1==c[2][2]-a2) {
								System.out.println("Yes");
								return;
							}
						}
					}
				} if(c[0][0]-a0==c[1][0]-a1&&c[1][0]-a1==c[2][0]-a2) {
						if(c[0][1]-a0==c[1][1]-a1&&c[1][1]-a1==c[2][1]-a2) {
							if(c[0][2]-a0==c[1][2]-a1&&c[1][2]-a1==c[2][2]-a2) {
								System.out.println("Yes");
								return;
							}
						}
					} c[0][0]-a0==c[1][0]-a1&&c[1][0]-a1==c[2][0]-a2 c[0][0]-a0==c[1][0]-a1 c[0][0]-a0 c[0][0] c[0] c 0 0 a0 c[1][0]-a1 c[1][0] c[1] c 1 0 a1 c[1][0]-a1==c[2][0]-a2 c[1][0]-a1 c[1][0] c[1] c 1 0 a1 c[2][0]-a2 c[2][0] c[2] c 2 0 a2 {
						if(c[0][1]-a0==c[1][1]-a1&&c[1][1]-a1==c[2][1]-a2) {
							if(c[0][2]-a0==c[1][2]-a1&&c[1][2]-a1==c[2][2]-a2) {
								System.out.println("Yes");
								return;
							}
						}
					} if(c[0][1]-a0==c[1][1]-a1&&c[1][1]-a1==c[2][1]-a2) {
							if(c[0][2]-a0==c[1][2]-a1&&c[1][2]-a1==c[2][2]-a2) {
								System.out.println("Yes");
								return;
							}
						} c[0][1]-a0==c[1][1]-a1&&c[1][1]-a1==c[2][1]-a2 c[0][1]-a0==c[1][1]-a1 c[0][1]-a0 c[0][1] c[0] c 0 1 a0 c[1][1]-a1 c[1][1] c[1] c 1 1 a1 c[1][1]-a1==c[2][1]-a2 c[1][1]-a1 c[1][1] c[1] c 1 1 a1 c[2][1]-a2 c[2][1] c[2] c 2 1 a2 {
							if(c[0][2]-a0==c[1][2]-a1&&c[1][2]-a1==c[2][2]-a2) {
								System.out.println("Yes");
								return;
							}
						} if(c[0][2]-a0==c[1][2]-a1&&c[1][2]-a1==c[2][2]-a2) {
								System.out.println("Yes");
								return;
							} c[0][2]-a0==c[1][2]-a1&&c[1][2]-a1==c[2][2]-a2 c[0][2]-a0==c[1][2]-a1 c[0][2]-a0 c[0][2] c[0] c 0 2 a0 c[1][2]-a1 c[1][2] c[1] c 1 2 a1 c[1][2]-a1==c[2][2]-a2 c[1][2]-a1 c[1][2] c[1] c 1 2 a1 c[2][2]-a2 c[2][2] c[2] c 2 2 a2 {
								System.out.println("Yes");
								return;
							} System.out.println("Yes") System.out.println System.out System System.out "Yes" return; System.out.println("No") System.out.println System.out System System.out "No" String[] args args static void printArray(int[] a) {
		int n=a.length;
		for(int i=0; i<n; i++) {
			if(i==0) System.out.print(a[i]);
			else System.out.print(" "+a[i]);
		}
		System.out.println();
	} printArray {
		int n=a.length;
		for(int i=0; i<n; i++) {
			if(i==0) System.out.print(a[i]);
			else System.out.print(" "+a[i]);
		}
		System.out.println();
	} int n=a.length; n a.length a a.length for(int i=0; i<n; i++) {
			if(i==0) System.out.print(a[i]);
			else System.out.print(" "+a[i]);
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			if(i==0) System.out.print(a[i]);
			else System.out.print(" "+a[i]);
		} {
			if(i==0) System.out.print(a[i]);
			else System.out.print(" "+a[i]);
		} if(i==0) System.out.print(a[i]);
			else System.out.print(" "+a[i]); i==0 i 0 System.out.print(a[i]) System.out.print System.out System System.out a[i] a i System.out.print(" "+a[i]) System.out.print System.out System System.out " "+a[i] " " a[i] a i System.out.println() System.out.println System.out System System.out int[] a a static class MyScanner
	{
		BufferedReader br;
		StringTokenizer st;
		public MyScanner(InputStream s) 
		{
			br=new BufferedReader(new InputStreamReader(s));
		}
		public String nextLine() throws IOException
		{
			return br.readLine();
		}
		public String next() throws IOException
		{
			while(st==null || !st.hasMoreTokens())
				st=new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int nextInt() throws IOException
		{
			return Integer.parseInt(next());
			
		}
		public double nextDouble() throws IOException
		{
			return Double.parseDouble(next());
		}
		public boolean ready() throws IOException
		{
			return br.ready();
		}
		public long nextLong() throws IOException
		{
			return Long.parseLong(next());
		}
	} MyScanner BufferedReader br; br StringTokenizer st; st public MyScanner(InputStream s) 
		{
			br=new BufferedReader(new InputStreamReader(s));
		} MyScanner {
			br=new BufferedReader(new InputStreamReader(s));
		} br=new BufferedReader(new InputStreamReader(s)) br new BufferedReader(new InputStreamReader(s)) InputStream s s public String nextLine() throws IOException
		{
			return br.readLine();
		} nextLine {
			return br.readLine();
		} return br.readLine(); br.readLine() br.readLine br public String next() throws IOException
		{
			while(st==null || !st.hasMoreTokens())
				st=new StringTokenizer(br.readLine());
			return st.nextToken();
		} next {
			while(st==null || !st.hasMoreTokens())
				st=new StringTokenizer(br.readLine());
			return st.nextToken();
		} while(st==null || !st.hasMoreTokens())
				st=new StringTokenizer(br.readLine()); st==null || !st.hasMoreTokens() st==null st null !st.hasMoreTokens() st.hasMoreTokens() st.hasMoreTokens st st=new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return st.nextToken(); st.nextToken() st.nextToken st public int nextInt() throws IOException
		{
			return Integer.parseInt(next());
			
		} nextInt {
			return Integer.parseInt(next());
			
		} return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next public double nextDouble() throws IOException
		{
			return Double.parseDouble(next());
		} nextDouble {
			return Double.parseDouble(next());
		} return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next public boolean ready() throws IOException
		{
			return br.ready();
		} ready {
			return br.ready();
		} return br.ready(); br.ready() br.ready br public long nextLong() throws IOException
		{
			return Long.parseLong(next());
		} nextLong {
			return Long.parseLong(next());
		} return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next public class Main {

	public static void main(String[] args) throws IOException {
		MyScanner sc = new MyScanner(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();
		}
		for(int a0=-300; a0<=300; a0++) {
			for(int a1=-300; a1<=300; a1++) {
				for(int a2=-300; a2<=300; a2++) {
					if(c[0][0]-a0==c[1][0]-a1&&c[1][0]-a1==c[2][0]-a2) {
						if(c[0][1]-a0==c[1][1]-a1&&c[1][1]-a1==c[2][1]-a2) {
							if(c[0][2]-a0==c[1][2]-a1&&c[1][2]-a1==c[2][2]-a2) {
								System.out.println("Yes");
								return;
							}
						}
					}
				}
			}
		}
		System.out.println("No");
 	}
	
	static void printArray(int[] a) {
		int n=a.length;
		for(int i=0; i<n; i++) {
			if(i==0) System.out.print(a[i]);
			else System.out.print(" "+a[i]);
		}
		System.out.println();
	}

	static class MyScanner
	{
		BufferedReader br;
		StringTokenizer st;
		public MyScanner(InputStream s) 
		{
			br=new BufferedReader(new InputStreamReader(s));
		}
		public String nextLine() throws IOException
		{
			return br.readLine();
		}
		public String next() throws IOException
		{
			while(st==null || !st.hasMoreTokens())
				st=new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int nextInt() throws IOException
		{
			return Integer.parseInt(next());
			
		}
		public double nextDouble() throws IOException
		{
			return Double.parseDouble(next());
		}
		public boolean ready() throws IOException
		{
			return br.ready();
		}
		public long nextLong() throws IOException
		{
			return Long.parseLong(next());
		}
	}
} public class Main {

	public static void main(String[] args) throws IOException {
		MyScanner sc = new MyScanner(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();
		}
		for(int a0=-300; a0<=300; a0++) {
			for(int a1=-300; a1<=300; a1++) {
				for(int a2=-300; a2<=300; a2++) {
					if(c[0][0]-a0==c[1][0]-a1&&c[1][0]-a1==c[2][0]-a2) {
						if(c[0][1]-a0==c[1][1]-a1&&c[1][1]-a1==c[2][1]-a2) {
							if(c[0][2]-a0==c[1][2]-a1&&c[1][2]-a1==c[2][2]-a2) {
								System.out.println("Yes");
								return;
							}
						}
					}
				}
			}
		}
		System.out.println("No");
 	}
	
	static void printArray(int[] a) {
		int n=a.length;
		for(int i=0; i<n; i++) {
			if(i==0) System.out.print(a[i]);
			else System.out.print(" "+a[i]);
		}
		System.out.println();
	}

	static class MyScanner
	{
		BufferedReader br;
		StringTokenizer st;
		public MyScanner(InputStream s) 
		{
			br=new BufferedReader(new InputStreamReader(s));
		}
		public String nextLine() throws IOException
		{
			return br.readLine();
		}
		public String next() throws IOException
		{
			while(st==null || !st.hasMoreTokens())
				st=new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int nextInt() throws IOException
		{
			return Integer.parseInt(next());
			
		}
		public double nextDouble() throws IOException
		{
			return Double.parseDouble(next());
		}
		public boolean ready() throws IOException
		{
			return br.ready();
		}
		public long nextLong() throws IOException
		{
			return Long.parseLong(next());
		}
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.*;

public class Main {

	public static void main(String[] args) throws IOException {
		MyScanner sc = new MyScanner(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();
		}
		for(int a0=-300; a0<=300; a0++) {
			for(int a1=-300; a1<=300; a1++) {
				for(int a2=-300; a2<=300; a2++) {
					if(c[0][0]-a0==c[1][0]-a1&&c[1][0]-a1==c[2][0]-a2) {
						if(c[0][1]-a0==c[1][1]-a1&&c[1][1]-a1==c[2][1]-a2) {
							if(c[0][2]-a0==c[1][2]-a1&&c[1][2]-a1==c[2][2]-a2) {
								System.out.println("Yes");
								return;
							}
						}
					}
				}
			}
		}
		System.out.println("No");
 	}
	
	static void printArray(int[] a) {
		int n=a.length;
		for(int i=0; i<n; i++) {
			if(i==0) System.out.print(a[i]);
			else System.out.print(" "+a[i]);
		}
		System.out.println();
	}

	static class MyScanner
	{
		BufferedReader br;
		StringTokenizer st;
		public MyScanner(InputStream s) 
		{
			br=new BufferedReader(new InputStreamReader(s));
		}
		public String nextLine() throws IOException
		{
			return br.readLine();
		}
		public String next() throws IOException
		{
			while(st==null || !st.hasMoreTokens())
				st=new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int nextInt() throws IOException
		{
			return Integer.parseInt(next());
			
		}
		public double nextDouble() throws IOException
		{
			return Double.parseDouble(next());
		}
		public boolean ready() throws IOException
		{
			return br.ready();
		}
		public long nextLong() throws IOException
		{
			return Long.parseLong(next());
		}
	}
}
