import java.util.*;
public class Main {
	public static void main(String[] args)  {
		Scanner scan = new Scanner(System.in);
		int[][] c = new int [3][3];
		for (int i = 0;i < 3; ++i){
			for (int k = 0;k < 3; ++k){
				c[i][k] = Integer.parseInt(scan.next());
			}
		}

		int[] x = new int [3];
		int[] y = new int [3];
		x[0] = 0;

		for (int i = 0;i < 3; ++i){
			y[i] = c[0][i]-x[0];
		}

		for (int i = 0;i < 3; ++i){
			x[i] = c[i][0]-y[0];
		}
		boolean ok = true;
		for (int i = 0;i < 3; ++i){
			for (int k = 0;k < 3; ++k){
				if (c[i][k] != x[i]+y[k]){
					ok = false;
				}
			}
		}

		System.out.print(ok?"Yes":"No");
	}
}

//end import java.util.*; util.* java public class Main {
	public static void main(String[] args)  {
		Scanner scan = new Scanner(System.in);
		int[][] c = new int [3][3];
		for (int i = 0;i < 3; ++i){
			for (int k = 0;k < 3; ++k){
				c[i][k] = Integer.parseInt(scan.next());
			}
		}

		int[] x = new int [3];
		int[] y = new int [3];
		x[0] = 0;

		for (int i = 0;i < 3; ++i){
			y[i] = c[0][i]-x[0];
		}

		for (int i = 0;i < 3; ++i){
			x[i] = c[i][0]-y[0];
		}
		boolean ok = true;
		for (int i = 0;i < 3; ++i){
			for (int k = 0;k < 3; ++k){
				if (c[i][k] != x[i]+y[k]){
					ok = false;
				}
			}
		}

		System.out.print(ok?"Yes":"No");
	}
} Main public static void main(String[] args)  {
		Scanner scan = new Scanner(System.in);
		int[][] c = new int [3][3];
		for (int i = 0;i < 3; ++i){
			for (int k = 0;k < 3; ++k){
				c[i][k] = Integer.parseInt(scan.next());
			}
		}

		int[] x = new int [3];
		int[] y = new int [3];
		x[0] = 0;

		for (int i = 0;i < 3; ++i){
			y[i] = c[0][i]-x[0];
		}

		for (int i = 0;i < 3; ++i){
			x[i] = c[i][0]-y[0];
		}
		boolean ok = true;
		for (int i = 0;i < 3; ++i){
			for (int k = 0;k < 3; ++k){
				if (c[i][k] != x[i]+y[k]){
					ok = false;
				}
			}
		}

		System.out.print(ok?"Yes":"No");
	} main {
		Scanner scan = new Scanner(System.in);
		int[][] c = new int [3][3];
		for (int i = 0;i < 3; ++i){
			for (int k = 0;k < 3; ++k){
				c[i][k] = Integer.parseInt(scan.next());
			}
		}

		int[] x = new int [3];
		int[] y = new int [3];
		x[0] = 0;

		for (int i = 0;i < 3; ++i){
			y[i] = c[0][i]-x[0];
		}

		for (int i = 0;i < 3; ++i){
			x[i] = c[i][0]-y[0];
		}
		boolean ok = true;
		for (int i = 0;i < 3; ++i){
			for (int k = 0;k < 3; ++k){
				if (c[i][k] != x[i]+y[k]){
					ok = false;
				}
			}
		}

		System.out.print(ok?"Yes":"No");
	} Scanner scan = new Scanner(System.in); scan 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 k = 0;k < 3; ++k){
				c[i][k] = Integer.parseInt(scan.next());
			}
		} int i = 0; int i = 0; i 0 i < 3 i 3 ++i ++i i {
			for (int k = 0;k < 3; ++k){
				c[i][k] = Integer.parseInt(scan.next());
			}
		} {
			for (int k = 0;k < 3; ++k){
				c[i][k] = Integer.parseInt(scan.next());
			}
		} for (int k = 0;k < 3; ++k){
				c[i][k] = Integer.parseInt(scan.next());
			} int k = 0; int k = 0; k 0 k < 3 k 3 ++k ++k k {
				c[i][k] = Integer.parseInt(scan.next());
			} {
				c[i][k] = Integer.parseInt(scan.next());
			} c[i][k] = Integer.parseInt(scan.next()) c[i][k] c[i] c i k Integer.parseInt(scan.next()) Integer.parseInt Integer scan.next() scan.next scan int[] x = new int [3]; x new int [3] 3 int[] y = new int [3]; y new int [3] 3 x[0] = 0 x[0] x 0 0 for (int i = 0;i < 3; ++i){
			y[i] = c[0][i]-x[0];
		} int i = 0; int i = 0; i 0 i < 3 i 3 ++i ++i i {
			y[i] = c[0][i]-x[0];
		} {
			y[i] = c[0][i]-x[0];
		} y[i] = c[0][i]-x[0] y[i] y i c[0][i]-x[0] c[0][i] c[0] c 0 i x[0] x 0 for (int i = 0;i < 3; ++i){
			x[i] = c[i][0]-y[0];
		} int i = 0; int i = 0; i 0 i < 3 i 3 ++i ++i i {
			x[i] = c[i][0]-y[0];
		} {
			x[i] = c[i][0]-y[0];
		} x[i] = c[i][0]-y[0] x[i] x i c[i][0]-y[0] c[i][0] c[i] c i 0 y[0] y 0 boolean ok = true; ok true for (int i = 0;i < 3; ++i){
			for (int k = 0;k < 3; ++k){
				if (c[i][k] != x[i]+y[k]){
					ok = false;
				}
			}
		} int i = 0; int i = 0; i 0 i < 3 i 3 ++i ++i i {
			for (int k = 0;k < 3; ++k){
				if (c[i][k] != x[i]+y[k]){
					ok = false;
				}
			}
		} {
			for (int k = 0;k < 3; ++k){
				if (c[i][k] != x[i]+y[k]){
					ok = false;
				}
			}
		} for (int k = 0;k < 3; ++k){
				if (c[i][k] != x[i]+y[k]){
					ok = false;
				}
			} int k = 0; int k = 0; k 0 k < 3 k 3 ++k ++k k {
				if (c[i][k] != x[i]+y[k]){
					ok = false;
				}
			} {
				if (c[i][k] != x[i]+y[k]){
					ok = false;
				}
			} if (c[i][k] != x[i]+y[k]){
					ok = false;
				} c[i][k] != x[i]+y[k] c[i][k] c[i] c i k x[i]+y[k] x[i] x i y[k] y k {
					ok = false;
				} ok = false ok false System.out.print(ok?"Yes":"No") System.out.print System.out System System.out ok?"Yes":"No" ok "Yes" "No" String[] args args public class Main {
	public static void main(String[] args)  {
		Scanner scan = new Scanner(System.in);
		int[][] c = new int [3][3];
		for (int i = 0;i < 3; ++i){
			for (int k = 0;k < 3; ++k){
				c[i][k] = Integer.parseInt(scan.next());
			}
		}

		int[] x = new int [3];
		int[] y = new int [3];
		x[0] = 0;

		for (int i = 0;i < 3; ++i){
			y[i] = c[0][i]-x[0];
		}

		for (int i = 0;i < 3; ++i){
			x[i] = c[i][0]-y[0];
		}
		boolean ok = true;
		for (int i = 0;i < 3; ++i){
			for (int k = 0;k < 3; ++k){
				if (c[i][k] != x[i]+y[k]){
					ok = false;
				}
			}
		}

		System.out.print(ok?"Yes":"No");
	}
} public class Main {
	public static void main(String[] args)  {
		Scanner scan = new Scanner(System.in);
		int[][] c = new int [3][3];
		for (int i = 0;i < 3; ++i){
			for (int k = 0;k < 3; ++k){
				c[i][k] = Integer.parseInt(scan.next());
			}
		}

		int[] x = new int [3];
		int[] y = new int [3];
		x[0] = 0;

		for (int i = 0;i < 3; ++i){
			y[i] = c[0][i]-x[0];
		}

		for (int i = 0;i < 3; ++i){
			x[i] = c[i][0]-y[0];
		}
		boolean ok = true;
		for (int i = 0;i < 3; ++i){
			for (int k = 0;k < 3; ++k){
				if (c[i][k] != x[i]+y[k]){
					ok = false;
				}
			}
		}

		System.out.print(ok?"Yes":"No");
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args)  {
		Scanner scan = new Scanner(System.in);
		int[][] c = new int [3][3];
		for (int i = 0;i < 3; ++i){
			for (int k = 0;k < 3; ++k){
				c[i][k] = Integer.parseInt(scan.next());
			}
		}

		int[] x = new int [3];
		int[] y = new int [3];
		x[0] = 0;

		for (int i = 0;i < 3; ++i){
			y[i] = c[0][i]-x[0];
		}

		for (int i = 0;i < 3; ++i){
			x[i] = c[i][0]-y[0];
		}
		boolean ok = true;
		for (int i = 0;i < 3; ++i){
			for (int k = 0;k < 3; ++k){
				if (c[i][k] != x[i]+y[k]){
					ok = false;
				}
			}
		}

		System.out.print(ok?"Yes":"No");
	}
}

//end