import java.util.*;

public class Main {
	
	static int c[][];

	public static boolean judge(int tmpa, int tmpb) {
		int b[] = new int[3];
		int a[] = new int[3];
		a[0] = tmpa;
		b[0] = tmpb;
		for(int i = 1; i < 3; ++i) 
			b[i] = c[0][i] - a[0];
		for(int i = 1; i < 3; ++i) 
			a[i] = c[i][0] - b[0];
		for(int i = 1; i  < 3; ++i) {
			for(int j = 1; j < 3; ++j) {
				int tmp = a[i] + b[j];
				if(c[i][j] != tmp)return false;
			}
		}
		return true;
	}
	
	public static boolean solve() {
		for(int i = 0; i <= c[0][0]; ++i) {
			if(judge(i, c[0][0] - i))return true;
		}
		return false;
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		c = new int[3][3];
		for (int i = 0; i < 3; ++i) {
			for (int j = 0; j < 3; ++j) 
				c[i][j] = sc.nextInt();
		}
		sc.close();
		int a = 1;
		String ans[] = { "Yes", "No" };
		if(solve())a = 0;
		System.out.println(ans[a]);
	}

} import java.util.*; util.* java public class Main {
	
	static int c[][];

	public static boolean judge(int tmpa, int tmpb) {
		int b[] = new int[3];
		int a[] = new int[3];
		a[0] = tmpa;
		b[0] = tmpb;
		for(int i = 1; i < 3; ++i) 
			b[i] = c[0][i] - a[0];
		for(int i = 1; i < 3; ++i) 
			a[i] = c[i][0] - b[0];
		for(int i = 1; i  < 3; ++i) {
			for(int j = 1; j < 3; ++j) {
				int tmp = a[i] + b[j];
				if(c[i][j] != tmp)return false;
			}
		}
		return true;
	}
	
	public static boolean solve() {
		for(int i = 0; i <= c[0][0]; ++i) {
			if(judge(i, c[0][0] - i))return true;
		}
		return false;
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		c = new int[3][3];
		for (int i = 0; i < 3; ++i) {
			for (int j = 0; j < 3; ++j) 
				c[i][j] = sc.nextInt();
		}
		sc.close();
		int a = 1;
		String ans[] = { "Yes", "No" };
		if(solve())a = 0;
		System.out.println(ans[a]);
	}

} Main static int c[][]; c public static boolean judge(int tmpa, int tmpb) {
		int b[] = new int[3];
		int a[] = new int[3];
		a[0] = tmpa;
		b[0] = tmpb;
		for(int i = 1; i < 3; ++i) 
			b[i] = c[0][i] - a[0];
		for(int i = 1; i < 3; ++i) 
			a[i] = c[i][0] - b[0];
		for(int i = 1; i  < 3; ++i) {
			for(int j = 1; j < 3; ++j) {
				int tmp = a[i] + b[j];
				if(c[i][j] != tmp)return false;
			}
		}
		return true;
	} judge {
		int b[] = new int[3];
		int a[] = new int[3];
		a[0] = tmpa;
		b[0] = tmpb;
		for(int i = 1; i < 3; ++i) 
			b[i] = c[0][i] - a[0];
		for(int i = 1; i < 3; ++i) 
			a[i] = c[i][0] - b[0];
		for(int i = 1; i  < 3; ++i) {
			for(int j = 1; j < 3; ++j) {
				int tmp = a[i] + b[j];
				if(c[i][j] != tmp)return false;
			}
		}
		return true;
	} int b[] = new int[3]; b new int[3] 3 int a[] = new int[3]; a new int[3] 3 a[0] = tmpa a[0] a 0 tmpa b[0] = tmpb b[0] b 0 tmpb for(int i = 1; i < 3; ++i) 
			b[i] = c[0][i] - a[0]; int i = 1; int i = 1; i 1 i < 3 i 3 ++i ++i i b[i] = c[0][i] - a[0]; b[i] = c[0][i] - a[0] b[i] b i c[0][i] - a[0] c[0][i] c[0] c 0 i a[0] a 0 for(int i = 1; i < 3; ++i) 
			a[i] = c[i][0] - b[0]; int i = 1; int i = 1; i 1 i < 3 i 3 ++i ++i i a[i] = c[i][0] - b[0]; a[i] = c[i][0] - b[0] a[i] a i c[i][0] - b[0] c[i][0] c[i] c i 0 b[0] b 0 for(int i = 1; i  < 3; ++i) {
			for(int j = 1; j < 3; ++j) {
				int tmp = a[i] + b[j];
				if(c[i][j] != tmp)return false;
			}
		} int i = 1; int i = 1; i 1 i  < 3 i 3 ++i ++i i {
			for(int j = 1; j < 3; ++j) {
				int tmp = a[i] + b[j];
				if(c[i][j] != tmp)return false;
			}
		} {
			for(int j = 1; j < 3; ++j) {
				int tmp = a[i] + b[j];
				if(c[i][j] != tmp)return false;
			}
		} for(int j = 1; j < 3; ++j) {
				int tmp = a[i] + b[j];
				if(c[i][j] != tmp)return false;
			} int j = 1; int j = 1; j 1 j < 3 j 3 ++j ++j j {
				int tmp = a[i] + b[j];
				if(c[i][j] != tmp)return false;
			} {
				int tmp = a[i] + b[j];
				if(c[i][j] != tmp)return false;
			} int tmp = a[i] + b[j]; tmp a[i] + b[j] a[i] a i b[j] b j if(c[i][j] != tmp)return false; c[i][j] != tmp c[i][j] c[i] c i j tmp return false; false return true; true int tmpa tmpa int tmpb tmpb public static boolean solve() {
		for(int i = 0; i <= c[0][0]; ++i) {
			if(judge(i, c[0][0] - i))return true;
		}
		return false;
	} solve {
		for(int i = 0; i <= c[0][0]; ++i) {
			if(judge(i, c[0][0] - i))return true;
		}
		return false;
	} for(int i = 0; i <= c[0][0]; ++i) {
			if(judge(i, c[0][0] - i))return true;
		} int i = 0; int i = 0; i 0 i <= c[0][0] i c[0][0] c[0] c 0 0 ++i ++i i {
			if(judge(i, c[0][0] - i))return true;
		} {
			if(judge(i, c[0][0] - i))return true;
		} if(judge(i, c[0][0] - i))return true; judge(i, c[0][0] - i) judge i c[0][0] - i c[0][0] c[0] c 0 0 i return true; true return false; false public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		c = new int[3][3];
		for (int i = 0; i < 3; ++i) {
			for (int j = 0; j < 3; ++j) 
				c[i][j] = sc.nextInt();
		}
		sc.close();
		int a = 1;
		String ans[] = { "Yes", "No" };
		if(solve())a = 0;
		System.out.println(ans[a]);
	} main {
		Scanner sc = new Scanner(System.in);
		c = new int[3][3];
		for (int i = 0; i < 3; ++i) {
			for (int j = 0; j < 3; ++j) 
				c[i][j] = sc.nextInt();
		}
		sc.close();
		int a = 1;
		String ans[] = { "Yes", "No" };
		if(solve())a = 0;
		System.out.println(ans[a]);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) 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 sc.close() sc.close sc int a = 1; a 1 String ans[] = { "Yes", "No" }; ans { "Yes", "No" } "Yes" "No" if(solve())a = 0; solve() solve a = 0 a 0 System.out.println(ans[a]) System.out.println System.out System System.out ans[a] ans a String[] args args public class Main {
	
	static int c[][];

	public static boolean judge(int tmpa, int tmpb) {
		int b[] = new int[3];
		int a[] = new int[3];
		a[0] = tmpa;
		b[0] = tmpb;
		for(int i = 1; i < 3; ++i) 
			b[i] = c[0][i] - a[0];
		for(int i = 1; i < 3; ++i) 
			a[i] = c[i][0] - b[0];
		for(int i = 1; i  < 3; ++i) {
			for(int j = 1; j < 3; ++j) {
				int tmp = a[i] + b[j];
				if(c[i][j] != tmp)return false;
			}
		}
		return true;
	}
	
	public static boolean solve() {
		for(int i = 0; i <= c[0][0]; ++i) {
			if(judge(i, c[0][0] - i))return true;
		}
		return false;
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		c = new int[3][3];
		for (int i = 0; i < 3; ++i) {
			for (int j = 0; j < 3; ++j) 
				c[i][j] = sc.nextInt();
		}
		sc.close();
		int a = 1;
		String ans[] = { "Yes", "No" };
		if(solve())a = 0;
		System.out.println(ans[a]);
	}

} public class Main {
	
	static int c[][];

	public static boolean judge(int tmpa, int tmpb) {
		int b[] = new int[3];
		int a[] = new int[3];
		a[0] = tmpa;
		b[0] = tmpb;
		for(int i = 1; i < 3; ++i) 
			b[i] = c[0][i] - a[0];
		for(int i = 1; i < 3; ++i) 
			a[i] = c[i][0] - b[0];
		for(int i = 1; i  < 3; ++i) {
			for(int j = 1; j < 3; ++j) {
				int tmp = a[i] + b[j];
				if(c[i][j] != tmp)return false;
			}
		}
		return true;
	}
	
	public static boolean solve() {
		for(int i = 0; i <= c[0][0]; ++i) {
			if(judge(i, c[0][0] - i))return true;
		}
		return false;
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		c = new int[3][3];
		for (int i = 0; i < 3; ++i) {
			for (int j = 0; j < 3; ++j) 
				c[i][j] = sc.nextInt();
		}
		sc.close();
		int a = 1;
		String ans[] = { "Yes", "No" };
		if(solve())a = 0;
		System.out.println(ans[a]);
	}

} Main
import java.util.*;

public class Main {
	
	static int c[][];

	public static boolean judge(int tmpa, int tmpb) {
		int b[] = new int[3];
		int a[] = new int[3];
		a[0] = tmpa;
		b[0] = tmpb;
		for(int i = 1; i < 3; ++i) 
			b[i] = c[0][i] - a[0];
		for(int i = 1; i < 3; ++i) 
			a[i] = c[i][0] - b[0];
		for(int i = 1; i  < 3; ++i) {
			for(int j = 1; j < 3; ++j) {
				int tmp = a[i] + b[j];
				if(c[i][j] != tmp)return false;
			}
		}
		return true;
	}
	
	public static boolean solve() {
		for(int i = 0; i <= c[0][0]; ++i) {
			if(judge(i, c[0][0] - i))return true;
		}
		return false;
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		c = new int[3][3];
		for (int i = 0; i < 3; ++i) {
			for (int j = 0; j < 3; ++j) 
				c[i][j] = sc.nextInt();
		}
		sc.close();
		int a = 1;
		String ans[] = { "Yes", "No" };
		if(solve())a = 0;
		System.out.println(ans[a]);
	}

}
