import java.util.*;
import java.io.*;
import java.nio.charset.StandardCharsets;

public class Main {
	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	}

	int[][] c;

	Main(BufferedReader in) throws IOException {
		c = new int[3][3];
		for (int i = 0; i < 3; ++i) {
			String[] tokens = in.readLine().split(" ");
			for (int j = 0; j < 3; ++j) {
				c[i][j] = Integer.parseInt(tokens[j]);
			}
		}
		for (int i = 0; i < 3; ++i) {
			for (int j = 1; j < 3; ++j) {
				c[j][i] -= c[0][i];
			}
		}
		for (int i = 0; i < 3; ++i) {
			c[0][i] = 0;
		}
		boolean enable = true;
		for (int i = 0; i < 3; ++i) {
			boolean cond = true;
			for (int j = 1; j < 3; ++j) {
				if (c[i][j] != c[i][0]) {
					cond = false;
				}
			}
			if (!cond) {
				enable = false;
				break;
			}
		}
		System.out.println((enable ? "Yes" : "No"));
	}

	void calc() {
	}

	void showResult() {
	}
} import java.util.*; util.* java import java.io.*; io.* java import java.nio.charset.StandardCharsets; StandardCharsets java.nio.charset public class Main {
	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	}

	int[][] c;

	Main(BufferedReader in) throws IOException {
		c = new int[3][3];
		for (int i = 0; i < 3; ++i) {
			String[] tokens = in.readLine().split(" ");
			for (int j = 0; j < 3; ++j) {
				c[i][j] = Integer.parseInt(tokens[j]);
			}
		}
		for (int i = 0; i < 3; ++i) {
			for (int j = 1; j < 3; ++j) {
				c[j][i] -= c[0][i];
			}
		}
		for (int i = 0; i < 3; ++i) {
			c[0][i] = 0;
		}
		boolean enable = true;
		for (int i = 0; i < 3; ++i) {
			boolean cond = true;
			for (int j = 1; j < 3; ++j) {
				if (c[i][j] != c[i][0]) {
					cond = false;
				}
			}
			if (!cond) {
				enable = false;
				break;
			}
		}
		System.out.println((enable ? "Yes" : "No"));
	}

	void calc() {
	}

	void showResult() {
	}
} Main int[][] c; c public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	} main {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	} InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8); reader new InputStreamReader(System.in, StandardCharsets.UTF_8) BufferedReader in = new BufferedReader(reader); in new BufferedReader(reader) Main ins = new Main(in); ins new Main(in) ins.calc() ins.calc ins ins.showResult() ins.showResult ins String[] args args Main(BufferedReader in) throws IOException {
		c = new int[3][3];
		for (int i = 0; i < 3; ++i) {
			String[] tokens = in.readLine().split(" ");
			for (int j = 0; j < 3; ++j) {
				c[i][j] = Integer.parseInt(tokens[j]);
			}
		}
		for (int i = 0; i < 3; ++i) {
			for (int j = 1; j < 3; ++j) {
				c[j][i] -= c[0][i];
			}
		}
		for (int i = 0; i < 3; ++i) {
			c[0][i] = 0;
		}
		boolean enable = true;
		for (int i = 0; i < 3; ++i) {
			boolean cond = true;
			for (int j = 1; j < 3; ++j) {
				if (c[i][j] != c[i][0]) {
					cond = false;
				}
			}
			if (!cond) {
				enable = false;
				break;
			}
		}
		System.out.println((enable ? "Yes" : "No"));
	} Main {
		c = new int[3][3];
		for (int i = 0; i < 3; ++i) {
			String[] tokens = in.readLine().split(" ");
			for (int j = 0; j < 3; ++j) {
				c[i][j] = Integer.parseInt(tokens[j]);
			}
		}
		for (int i = 0; i < 3; ++i) {
			for (int j = 1; j < 3; ++j) {
				c[j][i] -= c[0][i];
			}
		}
		for (int i = 0; i < 3; ++i) {
			c[0][i] = 0;
		}
		boolean enable = true;
		for (int i = 0; i < 3; ++i) {
			boolean cond = true;
			for (int j = 1; j < 3; ++j) {
				if (c[i][j] != c[i][0]) {
					cond = false;
				}
			}
			if (!cond) {
				enable = false;
				break;
			}
		}
		System.out.println((enable ? "Yes" : "No"));
	} c = new int[3][3] c new int[3][3] 3 3 for (int i = 0; i < 3; ++i) {
			String[] tokens = in.readLine().split(" ");
			for (int j = 0; j < 3; ++j) {
				c[i][j] = Integer.parseInt(tokens[j]);
			}
		} int i = 0; int i = 0; i 0 i < 3 i 3 ++i ++i i {
			String[] tokens = in.readLine().split(" ");
			for (int j = 0; j < 3; ++j) {
				c[i][j] = Integer.parseInt(tokens[j]);
			}
		} {
			String[] tokens = in.readLine().split(" ");
			for (int j = 0; j < 3; ++j) {
				c[i][j] = Integer.parseInt(tokens[j]);
			}
		} String[] tokens = in.readLine().split(" "); tokens in.readLine().split(" ") in.readLine().split in.readLine() in.readLine in " " for (int j = 0; j < 3; ++j) {
				c[i][j] = Integer.parseInt(tokens[j]);
			} int j = 0; int j = 0; j 0 j < 3 j 3 ++j ++j j {
				c[i][j] = Integer.parseInt(tokens[j]);
			} {
				c[i][j] = Integer.parseInt(tokens[j]);
			} c[i][j] = Integer.parseInt(tokens[j]) c[i][j] c[i] c i j Integer.parseInt(tokens[j]) Integer.parseInt Integer tokens[j] tokens j for (int i = 0; i < 3; ++i) {
			for (int j = 1; j < 3; ++j) {
				c[j][i] -= c[0][i];
			}
		} int i = 0; int i = 0; i 0 i < 3 i 3 ++i ++i i {
			for (int j = 1; j < 3; ++j) {
				c[j][i] -= c[0][i];
			}
		} {
			for (int j = 1; j < 3; ++j) {
				c[j][i] -= c[0][i];
			}
		} for (int j = 1; j < 3; ++j) {
				c[j][i] -= c[0][i];
			} int j = 1; int j = 1; j 1 j < 3 j 3 ++j ++j j {
				c[j][i] -= c[0][i];
			} {
				c[j][i] -= c[0][i];
			} c[j][i] -= c[0][i] c[j][i] c[j] c j i c[0][i] c[0] c 0 i for (int i = 0; i < 3; ++i) {
			c[0][i] = 0;
		} int i = 0; int i = 0; i 0 i < 3 i 3 ++i ++i i {
			c[0][i] = 0;
		} {
			c[0][i] = 0;
		} c[0][i] = 0 c[0][i] c[0] c 0 i 0 boolean enable = true; enable true for (int i = 0; i < 3; ++i) {
			boolean cond = true;
			for (int j = 1; j < 3; ++j) {
				if (c[i][j] != c[i][0]) {
					cond = false;
				}
			}
			if (!cond) {
				enable = false;
				break;
			}
		} int i = 0; int i = 0; i 0 i < 3 i 3 ++i ++i i {
			boolean cond = true;
			for (int j = 1; j < 3; ++j) {
				if (c[i][j] != c[i][0]) {
					cond = false;
				}
			}
			if (!cond) {
				enable = false;
				break;
			}
		} {
			boolean cond = true;
			for (int j = 1; j < 3; ++j) {
				if (c[i][j] != c[i][0]) {
					cond = false;
				}
			}
			if (!cond) {
				enable = false;
				break;
			}
		} boolean cond = true; cond true for (int j = 1; j < 3; ++j) {
				if (c[i][j] != c[i][0]) {
					cond = false;
				}
			} int j = 1; int j = 1; j 1 j < 3 j 3 ++j ++j j {
				if (c[i][j] != c[i][0]) {
					cond = false;
				}
			} {
				if (c[i][j] != c[i][0]) {
					cond = false;
				}
			} if (c[i][j] != c[i][0]) {
					cond = false;
				} c[i][j] != c[i][0] c[i][j] c[i] c i j c[i][0] c[i] c i 0 {
					cond = false;
				} cond = false cond false if (!cond) {
				enable = false;
				break;
			} !cond cond {
				enable = false;
				break;
			} enable = false enable false break; System.out.println((enable ? "Yes" : "No")) System.out.println System.out System System.out (enable ? "Yes" : "No") enable "Yes" "No" BufferedReader in in void calc() {
	} calc {
	} void showResult() {
	} showResult {
	} public class Main {
	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	}

	int[][] c;

	Main(BufferedReader in) throws IOException {
		c = new int[3][3];
		for (int i = 0; i < 3; ++i) {
			String[] tokens = in.readLine().split(" ");
			for (int j = 0; j < 3; ++j) {
				c[i][j] = Integer.parseInt(tokens[j]);
			}
		}
		for (int i = 0; i < 3; ++i) {
			for (int j = 1; j < 3; ++j) {
				c[j][i] -= c[0][i];
			}
		}
		for (int i = 0; i < 3; ++i) {
			c[0][i] = 0;
		}
		boolean enable = true;
		for (int i = 0; i < 3; ++i) {
			boolean cond = true;
			for (int j = 1; j < 3; ++j) {
				if (c[i][j] != c[i][0]) {
					cond = false;
				}
			}
			if (!cond) {
				enable = false;
				break;
			}
		}
		System.out.println((enable ? "Yes" : "No"));
	}

	void calc() {
	}

	void showResult() {
	}
} public class Main {
	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	}

	int[][] c;

	Main(BufferedReader in) throws IOException {
		c = new int[3][3];
		for (int i = 0; i < 3; ++i) {
			String[] tokens = in.readLine().split(" ");
			for (int j = 0; j < 3; ++j) {
				c[i][j] = Integer.parseInt(tokens[j]);
			}
		}
		for (int i = 0; i < 3; ++i) {
			for (int j = 1; j < 3; ++j) {
				c[j][i] -= c[0][i];
			}
		}
		for (int i = 0; i < 3; ++i) {
			c[0][i] = 0;
		}
		boolean enable = true;
		for (int i = 0; i < 3; ++i) {
			boolean cond = true;
			for (int j = 1; j < 3; ++j) {
				if (c[i][j] != c[i][0]) {
					cond = false;
				}
			}
			if (!cond) {
				enable = false;
				break;
			}
		}
		System.out.println((enable ? "Yes" : "No"));
	}

	void calc() {
	}

	void showResult() {
	}
} Main
import java.util.*;
import java.io.*;
import java.nio.charset.StandardCharsets;

public class Main {
	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	}

	int[][] c;

	Main(BufferedReader in) throws IOException {
		c = new int[3][3];
		for (int i = 0; i < 3; ++i) {
			String[] tokens = in.readLine().split(" ");
			for (int j = 0; j < 3; ++j) {
				c[i][j] = Integer.parseInt(tokens[j]);
			}
		}
		for (int i = 0; i < 3; ++i) {
			for (int j = 1; j < 3; ++j) {
				c[j][i] -= c[0][i];
			}
		}
		for (int i = 0; i < 3; ++i) {
			c[0][i] = 0;
		}
		boolean enable = true;
		for (int i = 0; i < 3; ++i) {
			boolean cond = true;
			for (int j = 1; j < 3; ++j) {
				if (c[i][j] != c[i][0]) {
					cond = false;
				}
			}
			if (!cond) {
				enable = false;
				break;
			}
		}
		System.out.println((enable ? "Yes" : "No"));
	}

	void calc() {
	}

	void showResult() {
	}
}
