import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/*
 * AtCoder Beginner Contest 088 C "Takahashi's Information"
 *   https://abc088.contest.atcoder.jp/tasks/abc088_c/
 */
public class Main {

	public static void main(String[] args) {

		InputScanner in = new InputScanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		int[][] c = in.nextIntArray(3, 3);

		int[] a = new int[3];
		int[] b = new int[3];

		a[0] = 0;
		b[0] = c[0][0] - a[0];
		b[1] = c[0][1] - a[0];
		b[2] = c[0][2] - a[0];
		a[1] = c[1][0] - b[0];
		a[2] = c[2][0] - b[0];

		String ans = "Yes";
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (c[i][j] != a[i] + b[j]) {
					ans = "No";
				}
			}
		}

		out.println(ans);

		in.close();
		out.close();
	}

	/*
	 * extends java.util.Scanner
	 */
	static class InputScanner {

		Scanner scanner;

		public InputScanner(InputStream inputStream) {
			this.scanner = new Scanner(inputStream);
		}

		public int nextInt() {
			return scanner.nextInt();
		}

		public long nextLong() {
			return scanner.nextLong();
		}

		public double nextDouble() {
			return scanner.nextDouble();
		}
		public String next() {
			return scanner.next();
		}

		public int[] nextIntArray(int n) {
			int[] ret = new int[n];
			for (int i = 0; i < n; i++) {
				ret[i] = scanner.nextInt();
			}
			return ret;
		}

		public int[][] nextIntArray(int h, int w) {
			int[][] ret = new int[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextInt();
				}
			}
			return ret;
		}

		public long[] nextLongArray(int n) {
			long[] ret = new long[n];
			for (int i = 0; i < n; i++) {
				ret[i] = scanner.nextLong();
			}
			return ret;
		}

		public long[][] nextlongArray(int h, int w) {
			long[][] ret = new long[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextLong();
				}
			}
			return ret;
		}

		public double[] nextDoubleArray(int n) {
			double[] ret = new double[n];
			for (int i = 0; i < n; i++) {
				ret[i] = scanner.nextDouble();
			}
			return ret;
		}

		public double[][] nextDoubleArray(int h, int w) {
			double[][] ret = new double[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextLong();
				}
			}
			return ret;
		}

		public String[] nextStringArray(int n) {
			String[] ret = new String[n];
			for (int i = 0; i < n; i++) {
				ret[i] = scanner.next();
			}
			return ret;
		}

		public String[] nextStringArray(String split) {
			String[] ret = scanner.next().split(split);
			return ret;
		}

		public String[][] nextStringArray(int h, int w) {
			String[][] ret = new String[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.next();
				}
			}
			return ret;
		}

		public String[][] nextStringArray(int h, String split) {
			String[][] ret = new String[h][];
			for (int i = 0; i < h; i++) {
				ret[i] = scanner.next().split(split);
			}
			return ret;
		}

		public void close() {
			scanner.close();
		}

	}

} import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		InputScanner in = new InputScanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		int[][] c = in.nextIntArray(3, 3);

		int[] a = new int[3];
		int[] b = new int[3];

		a[0] = 0;
		b[0] = c[0][0] - a[0];
		b[1] = c[0][1] - a[0];
		b[2] = c[0][2] - a[0];
		a[1] = c[1][0] - b[0];
		a[2] = c[2][0] - b[0];

		String ans = "Yes";
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (c[i][j] != a[i] + b[j]) {
					ans = "No";
				}
			}
		}

		out.println(ans);

		in.close();
		out.close();
	}

	/*
	 * extends java.util.Scanner
	 */
	static class InputScanner {

		Scanner scanner;

		public InputScanner(InputStream inputStream) {
			this.scanner = new Scanner(inputStream);
		}

		public int nextInt() {
			return scanner.nextInt();
		}

		public long nextLong() {
			return scanner.nextLong();
		}

		public double nextDouble() {
			return scanner.nextDouble();
		}
		public String next() {
			return scanner.next();
		}

		public int[] nextIntArray(int n) {
			int[] ret = new int[n];
			for (int i = 0; i < n; i++) {
				ret[i] = scanner.nextInt();
			}
			return ret;
		}

		public int[][] nextIntArray(int h, int w) {
			int[][] ret = new int[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextInt();
				}
			}
			return ret;
		}

		public long[] nextLongArray(int n) {
			long[] ret = new long[n];
			for (int i = 0; i < n; i++) {
				ret[i] = scanner.nextLong();
			}
			return ret;
		}

		public long[][] nextlongArray(int h, int w) {
			long[][] ret = new long[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextLong();
				}
			}
			return ret;
		}

		public double[] nextDoubleArray(int n) {
			double[] ret = new double[n];
			for (int i = 0; i < n; i++) {
				ret[i] = scanner.nextDouble();
			}
			return ret;
		}

		public double[][] nextDoubleArray(int h, int w) {
			double[][] ret = new double[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextLong();
				}
			}
			return ret;
		}

		public String[] nextStringArray(int n) {
			String[] ret = new String[n];
			for (int i = 0; i < n; i++) {
				ret[i] = scanner.next();
			}
			return ret;
		}

		public String[] nextStringArray(String split) {
			String[] ret = scanner.next().split(split);
			return ret;
		}

		public String[][] nextStringArray(int h, int w) {
			String[][] ret = new String[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.next();
				}
			}
			return ret;
		}

		public String[][] nextStringArray(int h, String split) {
			String[][] ret = new String[h][];
			for (int i = 0; i < h; i++) {
				ret[i] = scanner.next().split(split);
			}
			return ret;
		}

		public void close() {
			scanner.close();
		}

	}

} Main public static void main(String[] args) {

		InputScanner in = new InputScanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		int[][] c = in.nextIntArray(3, 3);

		int[] a = new int[3];
		int[] b = new int[3];

		a[0] = 0;
		b[0] = c[0][0] - a[0];
		b[1] = c[0][1] - a[0];
		b[2] = c[0][2] - a[0];
		a[1] = c[1][0] - b[0];
		a[2] = c[2][0] - b[0];

		String ans = "Yes";
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (c[i][j] != a[i] + b[j]) {
					ans = "No";
				}
			}
		}

		out.println(ans);

		in.close();
		out.close();
	} main {

		InputScanner in = new InputScanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		int[][] c = in.nextIntArray(3, 3);

		int[] a = new int[3];
		int[] b = new int[3];

		a[0] = 0;
		b[0] = c[0][0] - a[0];
		b[1] = c[0][1] - a[0];
		b[2] = c[0][2] - a[0];
		a[1] = c[1][0] - b[0];
		a[2] = c[2][0] - b[0];

		String ans = "Yes";
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (c[i][j] != a[i] + b[j]) {
					ans = "No";
				}
			}
		}

		out.println(ans);

		in.close();
		out.close();
	} InputScanner in = new InputScanner(System.in); in new InputScanner(System.in) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) int[][] c = in.nextIntArray(3, 3); c in.nextIntArray(3, 3) in.nextIntArray in 3 3 int[] a = new int[3]; a new int[3] 3 int[] b = new int[3]; b new int[3] 3 a[0] = 0 a[0] a 0 0 b[0] = c[0][0] - a[0] b[0] b 0 c[0][0] - a[0] c[0][0] c[0] c 0 0 a[0] a 0 b[1] = c[0][1] - a[0] b[1] b 1 c[0][1] - a[0] c[0][1] c[0] c 0 1 a[0] a 0 b[2] = c[0][2] - a[0] b[2] b 2 c[0][2] - a[0] c[0][2] c[0] c 0 2 a[0] a 0 a[1] = c[1][0] - b[0] a[1] a 1 c[1][0] - b[0] c[1][0] c[1] c 1 0 b[0] b 0 a[2] = c[2][0] - b[0] a[2] a 2 c[2][0] - b[0] c[2][0] c[2] c 2 0 b[0] b 0 String ans = "Yes"; ans "Yes" for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (c[i][j] != a[i] + b[j]) {
					ans = "No";
				}
			}
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			for (int j = 0; j < 3; j++) {
				if (c[i][j] != a[i] + b[j]) {
					ans = "No";
				}
			}
		} {
			for (int j = 0; j < 3; j++) {
				if (c[i][j] != a[i] + b[j]) {
					ans = "No";
				}
			}
		} for (int j = 0; j < 3; j++) {
				if (c[i][j] != a[i] + b[j]) {
					ans = "No";
				}
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				if (c[i][j] != a[i] + b[j]) {
					ans = "No";
				}
			} {
				if (c[i][j] != a[i] + b[j]) {
					ans = "No";
				}
			} if (c[i][j] != a[i] + b[j]) {
					ans = "No";
				} c[i][j] != a[i] + b[j] c[i][j] c[i] c i j a[i] + b[j] a[i] a i b[j] b j {
					ans = "No";
				} ans = "No" ans "No" out.println(ans) out.println out ans in.close() in.close in out.close() out.close out String[] args args static class InputScanner {

		Scanner scanner;

		public InputScanner(InputStream inputStream) {
			this.scanner = new Scanner(inputStream);
		}

		public int nextInt() {
			return scanner.nextInt();
		}

		public long nextLong() {
			return scanner.nextLong();
		}

		public double nextDouble() {
			return scanner.nextDouble();
		}
		public String next() {
			return scanner.next();
		}

		public int[] nextIntArray(int n) {
			int[] ret = new int[n];
			for (int i = 0; i < n; i++) {
				ret[i] = scanner.nextInt();
			}
			return ret;
		}

		public int[][] nextIntArray(int h, int w) {
			int[][] ret = new int[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextInt();
				}
			}
			return ret;
		}

		public long[] nextLongArray(int n) {
			long[] ret = new long[n];
			for (int i = 0; i < n; i++) {
				ret[i] = scanner.nextLong();
			}
			return ret;
		}

		public long[][] nextlongArray(int h, int w) {
			long[][] ret = new long[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextLong();
				}
			}
			return ret;
		}

		public double[] nextDoubleArray(int n) {
			double[] ret = new double[n];
			for (int i = 0; i < n; i++) {
				ret[i] = scanner.nextDouble();
			}
			return ret;
		}

		public double[][] nextDoubleArray(int h, int w) {
			double[][] ret = new double[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextLong();
				}
			}
			return ret;
		}

		public String[] nextStringArray(int n) {
			String[] ret = new String[n];
			for (int i = 0; i < n; i++) {
				ret[i] = scanner.next();
			}
			return ret;
		}

		public String[] nextStringArray(String split) {
			String[] ret = scanner.next().split(split);
			return ret;
		}

		public String[][] nextStringArray(int h, int w) {
			String[][] ret = new String[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.next();
				}
			}
			return ret;
		}

		public String[][] nextStringArray(int h, String split) {
			String[][] ret = new String[h][];
			for (int i = 0; i < h; i++) {
				ret[i] = scanner.next().split(split);
			}
			return ret;
		}

		public void close() {
			scanner.close();
		}

	} InputScanner Scanner scanner; scanner public InputScanner(InputStream inputStream) {
			this.scanner = new Scanner(inputStream);
		} InputScanner {
			this.scanner = new Scanner(inputStream);
		} this.scanner = new Scanner(inputStream) this.scanner this this.scanner new Scanner(inputStream) InputStream inputStream inputStream public int nextInt() {
			return scanner.nextInt();
		} nextInt {
			return scanner.nextInt();
		} return scanner.nextInt(); scanner.nextInt() scanner.nextInt scanner public long nextLong() {
			return scanner.nextLong();
		} nextLong {
			return scanner.nextLong();
		} return scanner.nextLong(); scanner.nextLong() scanner.nextLong scanner public double nextDouble() {
			return scanner.nextDouble();
		} nextDouble {
			return scanner.nextDouble();
		} return scanner.nextDouble(); scanner.nextDouble() scanner.nextDouble scanner public String next() {
			return scanner.next();
		} next {
			return scanner.next();
		} return scanner.next(); scanner.next() scanner.next scanner public int[] nextIntArray(int n) {
			int[] ret = new int[n];
			for (int i = 0; i < n; i++) {
				ret[i] = scanner.nextInt();
			}
			return ret;
		} nextIntArray {
			int[] ret = new int[n];
			for (int i = 0; i < n; i++) {
				ret[i] = scanner.nextInt();
			}
			return ret;
		} int[] ret = new int[n]; ret new int[n] n for (int i = 0; i < n; i++) {
				ret[i] = scanner.nextInt();
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
				ret[i] = scanner.nextInt();
			} {
				ret[i] = scanner.nextInt();
			} ret[i] = scanner.nextInt() ret[i] ret i scanner.nextInt() scanner.nextInt scanner return ret; ret int n n public int[][] nextIntArray(int h, int w) {
			int[][] ret = new int[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextInt();
				}
			}
			return ret;
		} nextIntArray {
			int[][] ret = new int[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextInt();
				}
			}
			return ret;
		} int[][] ret = new int[h][w]; ret new int[h][w] h w for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextInt();
				}
			} int i = 0; int i = 0; i 0 i < h i h i++ i++ i {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextInt();
				}
			} {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextInt();
				}
			} for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextInt();
				} int j = 0; int j = 0; j 0 j < w j w j++ j++ j {
					ret[i][j] = scanner.nextInt();
				} {
					ret[i][j] = scanner.nextInt();
				} ret[i][j] = scanner.nextInt() ret[i][j] ret[i] ret i j scanner.nextInt() scanner.nextInt scanner return ret; ret int h h int w w public long[] nextLongArray(int n) {
			long[] ret = new long[n];
			for (int i = 0; i < n; i++) {
				ret[i] = scanner.nextLong();
			}
			return ret;
		} nextLongArray {
			long[] ret = new long[n];
			for (int i = 0; i < n; i++) {
				ret[i] = scanner.nextLong();
			}
			return ret;
		} long[] ret = new long[n]; ret new long[n] n for (int i = 0; i < n; i++) {
				ret[i] = scanner.nextLong();
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
				ret[i] = scanner.nextLong();
			} {
				ret[i] = scanner.nextLong();
			} ret[i] = scanner.nextLong() ret[i] ret i scanner.nextLong() scanner.nextLong scanner return ret; ret int n n public long[][] nextlongArray(int h, int w) {
			long[][] ret = new long[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextLong();
				}
			}
			return ret;
		} nextlongArray {
			long[][] ret = new long[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextLong();
				}
			}
			return ret;
		} long[][] ret = new long[h][w]; ret new long[h][w] h w for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextLong();
				}
			} int i = 0; int i = 0; i 0 i < h i h i++ i++ i {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextLong();
				}
			} {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextLong();
				}
			} for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextLong();
				} int j = 0; int j = 0; j 0 j < w j w j++ j++ j {
					ret[i][j] = scanner.nextLong();
				} {
					ret[i][j] = scanner.nextLong();
				} ret[i][j] = scanner.nextLong() ret[i][j] ret[i] ret i j scanner.nextLong() scanner.nextLong scanner return ret; ret int h h int w w public double[] nextDoubleArray(int n) {
			double[] ret = new double[n];
			for (int i = 0; i < n; i++) {
				ret[i] = scanner.nextDouble();
			}
			return ret;
		} nextDoubleArray {
			double[] ret = new double[n];
			for (int i = 0; i < n; i++) {
				ret[i] = scanner.nextDouble();
			}
			return ret;
		} double[] ret = new double[n]; ret new double[n] n for (int i = 0; i < n; i++) {
				ret[i] = scanner.nextDouble();
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
				ret[i] = scanner.nextDouble();
			} {
				ret[i] = scanner.nextDouble();
			} ret[i] = scanner.nextDouble() ret[i] ret i scanner.nextDouble() scanner.nextDouble scanner return ret; ret int n n public double[][] nextDoubleArray(int h, int w) {
			double[][] ret = new double[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextLong();
				}
			}
			return ret;
		} nextDoubleArray {
			double[][] ret = new double[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextLong();
				}
			}
			return ret;
		} double[][] ret = new double[h][w]; ret new double[h][w] h w for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextLong();
				}
			} int i = 0; int i = 0; i 0 i < h i h i++ i++ i {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextLong();
				}
			} {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextLong();
				}
			} for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextLong();
				} int j = 0; int j = 0; j 0 j < w j w j++ j++ j {
					ret[i][j] = scanner.nextLong();
				} {
					ret[i][j] = scanner.nextLong();
				} ret[i][j] = scanner.nextLong() ret[i][j] ret[i] ret i j scanner.nextLong() scanner.nextLong scanner return ret; ret int h h int w w public String[] nextStringArray(int n) {
			String[] ret = new String[n];
			for (int i = 0; i < n; i++) {
				ret[i] = scanner.next();
			}
			return ret;
		} nextStringArray {
			String[] ret = new String[n];
			for (int i = 0; i < n; i++) {
				ret[i] = scanner.next();
			}
			return ret;
		} String[] ret = new String[n]; ret new String[n] n for (int i = 0; i < n; i++) {
				ret[i] = scanner.next();
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
				ret[i] = scanner.next();
			} {
				ret[i] = scanner.next();
			} ret[i] = scanner.next() ret[i] ret i scanner.next() scanner.next scanner return ret; ret int n n public String[] nextStringArray(String split) {
			String[] ret = scanner.next().split(split);
			return ret;
		} nextStringArray {
			String[] ret = scanner.next().split(split);
			return ret;
		} String[] ret = scanner.next().split(split); ret scanner.next().split(split) scanner.next().split scanner.next() scanner.next scanner split return ret; ret String split split public String[][] nextStringArray(int h, int w) {
			String[][] ret = new String[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.next();
				}
			}
			return ret;
		} nextStringArray {
			String[][] ret = new String[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.next();
				}
			}
			return ret;
		} String[][] ret = new String[h][w]; ret new String[h][w] h w for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.next();
				}
			} int i = 0; int i = 0; i 0 i < h i h i++ i++ i {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.next();
				}
			} {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.next();
				}
			} for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.next();
				} int j = 0; int j = 0; j 0 j < w j w j++ j++ j {
					ret[i][j] = scanner.next();
				} {
					ret[i][j] = scanner.next();
				} ret[i][j] = scanner.next() ret[i][j] ret[i] ret i j scanner.next() scanner.next scanner return ret; ret int h h int w w public String[][] nextStringArray(int h, String split) {
			String[][] ret = new String[h][];
			for (int i = 0; i < h; i++) {
				ret[i] = scanner.next().split(split);
			}
			return ret;
		} nextStringArray {
			String[][] ret = new String[h][];
			for (int i = 0; i < h; i++) {
				ret[i] = scanner.next().split(split);
			}
			return ret;
		} String[][] ret = new String[h][]; ret new String[h][] h for (int i = 0; i < h; i++) {
				ret[i] = scanner.next().split(split);
			} int i = 0; int i = 0; i 0 i < h i h i++ i++ i {
				ret[i] = scanner.next().split(split);
			} {
				ret[i] = scanner.next().split(split);
			} ret[i] = scanner.next().split(split) ret[i] ret i scanner.next().split(split) scanner.next().split scanner.next() scanner.next scanner split return ret; ret int h h String split split public void close() {
			scanner.close();
		} close {
			scanner.close();
		} scanner.close() scanner.close scanner public class Main {

	public static void main(String[] args) {

		InputScanner in = new InputScanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		int[][] c = in.nextIntArray(3, 3);

		int[] a = new int[3];
		int[] b = new int[3];

		a[0] = 0;
		b[0] = c[0][0] - a[0];
		b[1] = c[0][1] - a[0];
		b[2] = c[0][2] - a[0];
		a[1] = c[1][0] - b[0];
		a[2] = c[2][0] - b[0];

		String ans = "Yes";
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (c[i][j] != a[i] + b[j]) {
					ans = "No";
				}
			}
		}

		out.println(ans);

		in.close();
		out.close();
	}

	/*
	 * extends java.util.Scanner
	 */
	static class InputScanner {

		Scanner scanner;

		public InputScanner(InputStream inputStream) {
			this.scanner = new Scanner(inputStream);
		}

		public int nextInt() {
			return scanner.nextInt();
		}

		public long nextLong() {
			return scanner.nextLong();
		}

		public double nextDouble() {
			return scanner.nextDouble();
		}
		public String next() {
			return scanner.next();
		}

		public int[] nextIntArray(int n) {
			int[] ret = new int[n];
			for (int i = 0; i < n; i++) {
				ret[i] = scanner.nextInt();
			}
			return ret;
		}

		public int[][] nextIntArray(int h, int w) {
			int[][] ret = new int[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextInt();
				}
			}
			return ret;
		}

		public long[] nextLongArray(int n) {
			long[] ret = new long[n];
			for (int i = 0; i < n; i++) {
				ret[i] = scanner.nextLong();
			}
			return ret;
		}

		public long[][] nextlongArray(int h, int w) {
			long[][] ret = new long[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextLong();
				}
			}
			return ret;
		}

		public double[] nextDoubleArray(int n) {
			double[] ret = new double[n];
			for (int i = 0; i < n; i++) {
				ret[i] = scanner.nextDouble();
			}
			return ret;
		}

		public double[][] nextDoubleArray(int h, int w) {
			double[][] ret = new double[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextLong();
				}
			}
			return ret;
		}

		public String[] nextStringArray(int n) {
			String[] ret = new String[n];
			for (int i = 0; i < n; i++) {
				ret[i] = scanner.next();
			}
			return ret;
		}

		public String[] nextStringArray(String split) {
			String[] ret = scanner.next().split(split);
			return ret;
		}

		public String[][] nextStringArray(int h, int w) {
			String[][] ret = new String[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.next();
				}
			}
			return ret;
		}

		public String[][] nextStringArray(int h, String split) {
			String[][] ret = new String[h][];
			for (int i = 0; i < h; i++) {
				ret[i] = scanner.next().split(split);
			}
			return ret;
		}

		public void close() {
			scanner.close();
		}

	}

} public class Main {

	public static void main(String[] args) {

		InputScanner in = new InputScanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		int[][] c = in.nextIntArray(3, 3);

		int[] a = new int[3];
		int[] b = new int[3];

		a[0] = 0;
		b[0] = c[0][0] - a[0];
		b[1] = c[0][1] - a[0];
		b[2] = c[0][2] - a[0];
		a[1] = c[1][0] - b[0];
		a[2] = c[2][0] - b[0];

		String ans = "Yes";
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (c[i][j] != a[i] + b[j]) {
					ans = "No";
				}
			}
		}

		out.println(ans);

		in.close();
		out.close();
	}

	/*
	 * extends java.util.Scanner
	 */
	static class InputScanner {

		Scanner scanner;

		public InputScanner(InputStream inputStream) {
			this.scanner = new Scanner(inputStream);
		}

		public int nextInt() {
			return scanner.nextInt();
		}

		public long nextLong() {
			return scanner.nextLong();
		}

		public double nextDouble() {
			return scanner.nextDouble();
		}
		public String next() {
			return scanner.next();
		}

		public int[] nextIntArray(int n) {
			int[] ret = new int[n];
			for (int i = 0; i < n; i++) {
				ret[i] = scanner.nextInt();
			}
			return ret;
		}

		public int[][] nextIntArray(int h, int w) {
			int[][] ret = new int[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextInt();
				}
			}
			return ret;
		}

		public long[] nextLongArray(int n) {
			long[] ret = new long[n];
			for (int i = 0; i < n; i++) {
				ret[i] = scanner.nextLong();
			}
			return ret;
		}

		public long[][] nextlongArray(int h, int w) {
			long[][] ret = new long[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextLong();
				}
			}
			return ret;
		}

		public double[] nextDoubleArray(int n) {
			double[] ret = new double[n];
			for (int i = 0; i < n; i++) {
				ret[i] = scanner.nextDouble();
			}
			return ret;
		}

		public double[][] nextDoubleArray(int h, int w) {
			double[][] ret = new double[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextLong();
				}
			}
			return ret;
		}

		public String[] nextStringArray(int n) {
			String[] ret = new String[n];
			for (int i = 0; i < n; i++) {
				ret[i] = scanner.next();
			}
			return ret;
		}

		public String[] nextStringArray(String split) {
			String[] ret = scanner.next().split(split);
			return ret;
		}

		public String[][] nextStringArray(int h, int w) {
			String[][] ret = new String[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.next();
				}
			}
			return ret;
		}

		public String[][] nextStringArray(int h, String split) {
			String[][] ret = new String[h][];
			for (int i = 0; i < h; i++) {
				ret[i] = scanner.next().split(split);
			}
			return ret;
		}

		public void close() {
			scanner.close();
		}

	}

} Main
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/*
 * AtCoder Beginner Contest 088 C "Takahashi's Information"
 *   https://abc088.contest.atcoder.jp/tasks/abc088_c/
 */
public class Main {

	public static void main(String[] args) {

		InputScanner in = new InputScanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		int[][] c = in.nextIntArray(3, 3);

		int[] a = new int[3];
		int[] b = new int[3];

		a[0] = 0;
		b[0] = c[0][0] - a[0];
		b[1] = c[0][1] - a[0];
		b[2] = c[0][2] - a[0];
		a[1] = c[1][0] - b[0];
		a[2] = c[2][0] - b[0];

		String ans = "Yes";
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (c[i][j] != a[i] + b[j]) {
					ans = "No";
				}
			}
		}

		out.println(ans);

		in.close();
		out.close();
	}

	/*
	 * extends java.util.Scanner
	 */
	static class InputScanner {

		Scanner scanner;

		public InputScanner(InputStream inputStream) {
			this.scanner = new Scanner(inputStream);
		}

		public int nextInt() {
			return scanner.nextInt();
		}

		public long nextLong() {
			return scanner.nextLong();
		}

		public double nextDouble() {
			return scanner.nextDouble();
		}
		public String next() {
			return scanner.next();
		}

		public int[] nextIntArray(int n) {
			int[] ret = new int[n];
			for (int i = 0; i < n; i++) {
				ret[i] = scanner.nextInt();
			}
			return ret;
		}

		public int[][] nextIntArray(int h, int w) {
			int[][] ret = new int[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextInt();
				}
			}
			return ret;
		}

		public long[] nextLongArray(int n) {
			long[] ret = new long[n];
			for (int i = 0; i < n; i++) {
				ret[i] = scanner.nextLong();
			}
			return ret;
		}

		public long[][] nextlongArray(int h, int w) {
			long[][] ret = new long[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextLong();
				}
			}
			return ret;
		}

		public double[] nextDoubleArray(int n) {
			double[] ret = new double[n];
			for (int i = 0; i < n; i++) {
				ret[i] = scanner.nextDouble();
			}
			return ret;
		}

		public double[][] nextDoubleArray(int h, int w) {
			double[][] ret = new double[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextLong();
				}
			}
			return ret;
		}

		public String[] nextStringArray(int n) {
			String[] ret = new String[n];
			for (int i = 0; i < n; i++) {
				ret[i] = scanner.next();
			}
			return ret;
		}

		public String[] nextStringArray(String split) {
			String[] ret = scanner.next().split(split);
			return ret;
		}

		public String[][] nextStringArray(int h, int w) {
			String[][] ret = new String[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.next();
				}
			}
			return ret;
		}

		public String[][] nextStringArray(int h, String split) {
			String[][] ret = new String[h][];
			for (int i = 0; i < h; i++) {
				ret[i] = scanner.next().split(split);
			}
			return ret;
		}

		public void close() {
			scanner.close();
		}

	}

}
