import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {
	public static void main(String args[]) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		Solver solver = new Solver();
		solver.init();
		// solver.readHead(in.readLine());
		for (; solver.hasNext();) {
			solver.readBody(in.readLine());
		}
		solver.solve();
	}
}

class Solver {
	int N;
	int cnt;
	int[][] C;

	public void init() {
		N = 0;
		cnt = 0;
		C = new int[3][3];
	}

	public void readHead(String str) {
		String[] strArr = str.split(" ");
		N = Integer.parseInt(strArr[0]);
		// System.out.println(N);
	}

	public boolean hasNext() {
		// return cnt < N;
		return cnt < 3;
	}

	public void readBody(String str) {
		// System.out.println(str);
		String[] strArr = str.split(" ");
		for (int i = 0; i < 3; i++)
			C[cnt][i] = Integer.parseInt(strArr[i]);
		cnt++;
	}

	public void solve() {
		if (judge())
			System.out.println("Yes");
		else
			System.out.println("No");
	}

	private boolean judge() {
		if (C[0][1] - C[0][0] != C[1][1] - C[1][0])
			return false;
		if (C[0][1] - C[0][0] != C[2][1] - C[2][0])
			return false;
		if (C[0][2] - C[0][0] != C[1][2] - C[1][0])
			return false;
		if (C[0][2] - C[0][0] != C[2][2] - C[2][0])
			return false;
		if (C[1][0] - C[0][0] != C[1][1] - C[0][1])
			return false;
		if (C[1][0] - C[0][0] != C[1][2] - C[0][2])
			return false;
		if (C[2][0] - C[0][0] != C[2][1] - C[0][1])
			return false;
		if (C[2][0] - C[0][0] != C[2][2] - C[0][2])
			return false;
		return true;
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io class Main {
	public static void main(String args[]) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		Solver solver = new Solver();
		solver.init();
		// solver.readHead(in.readLine());
		for (; solver.hasNext();) {
			solver.readBody(in.readLine());
		}
		solver.solve();
	}
} Main public static void main(String args[]) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		Solver solver = new Solver();
		solver.init();
		// solver.readHead(in.readLine());
		for (; solver.hasNext();) {
			solver.readBody(in.readLine());
		}
		solver.solve();
	} main {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		Solver solver = new Solver();
		solver.init();
		// solver.readHead(in.readLine());
		for (; solver.hasNext();) {
			solver.readBody(in.readLine());
		}
		solver.solve();
	} BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) Solver solver = new Solver(); solver new Solver() solver.init() solver.init solver for (; solver.hasNext();) {
			solver.readBody(in.readLine());
		} ; solver.hasNext() solver.hasNext solver {
			solver.readBody(in.readLine());
		} {
			solver.readBody(in.readLine());
		} solver.readBody(in.readLine()) solver.readBody solver in.readLine() in.readLine in solver.solve() solver.solve solver String args[] args class Solver {
	int N;
	int cnt;
	int[][] C;

	public void init() {
		N = 0;
		cnt = 0;
		C = new int[3][3];
	}

	public void readHead(String str) {
		String[] strArr = str.split(" ");
		N = Integer.parseInt(strArr[0]);
		// System.out.println(N);
	}

	public boolean hasNext() {
		// return cnt < N;
		return cnt < 3;
	}

	public void readBody(String str) {
		// System.out.println(str);
		String[] strArr = str.split(" ");
		for (int i = 0; i < 3; i++)
			C[cnt][i] = Integer.parseInt(strArr[i]);
		cnt++;
	}

	public void solve() {
		if (judge())
			System.out.println("Yes");
		else
			System.out.println("No");
	}

	private boolean judge() {
		if (C[0][1] - C[0][0] != C[1][1] - C[1][0])
			return false;
		if (C[0][1] - C[0][0] != C[2][1] - C[2][0])
			return false;
		if (C[0][2] - C[0][0] != C[1][2] - C[1][0])
			return false;
		if (C[0][2] - C[0][0] != C[2][2] - C[2][0])
			return false;
		if (C[1][0] - C[0][0] != C[1][1] - C[0][1])
			return false;
		if (C[1][0] - C[0][0] != C[1][2] - C[0][2])
			return false;
		if (C[2][0] - C[0][0] != C[2][1] - C[0][1])
			return false;
		if (C[2][0] - C[0][0] != C[2][2] - C[0][2])
			return false;
		return true;
	}
} Solver int N; N int cnt; cnt int[][] C; C public void init() {
		N = 0;
		cnt = 0;
		C = new int[3][3];
	} init {
		N = 0;
		cnt = 0;
		C = new int[3][3];
	} N = 0 N 0 cnt = 0 cnt 0 C = new int[3][3] C new int[3][3] 3 3 public void readHead(String str) {
		String[] strArr = str.split(" ");
		N = Integer.parseInt(strArr[0]);
		// System.out.println(N);
	} readHead {
		String[] strArr = str.split(" ");
		N = Integer.parseInt(strArr[0]);
		// System.out.println(N);
	} String[] strArr = str.split(" "); strArr str.split(" ") str.split str " " N = Integer.parseInt(strArr[0]) N Integer.parseInt(strArr[0]) Integer.parseInt Integer strArr[0] strArr 0 String str str public boolean hasNext() {
		// return cnt < N;
		return cnt < 3;
	} hasNext {
		// return cnt < N;
		return cnt < 3;
	} return cnt < 3; cnt < 3 cnt 3 public void readBody(String str) {
		// System.out.println(str);
		String[] strArr = str.split(" ");
		for (int i = 0; i < 3; i++)
			C[cnt][i] = Integer.parseInt(strArr[i]);
		cnt++;
	} readBody {
		// System.out.println(str);
		String[] strArr = str.split(" ");
		for (int i = 0; i < 3; i++)
			C[cnt][i] = Integer.parseInt(strArr[i]);
		cnt++;
	} String[] strArr = str.split(" "); strArr str.split(" ") str.split str " " for (int i = 0; i < 3; i++)
			C[cnt][i] = Integer.parseInt(strArr[i]); int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i C[cnt][i] = Integer.parseInt(strArr[i]); C[cnt][i] = Integer.parseInt(strArr[i]) C[cnt][i] C[cnt] C cnt i Integer.parseInt(strArr[i]) Integer.parseInt Integer strArr[i] strArr i cnt++ cnt String str str public void solve() {
		if (judge())
			System.out.println("Yes");
		else
			System.out.println("No");
	} solve {
		if (judge())
			System.out.println("Yes");
		else
			System.out.println("No");
	} if (judge())
			System.out.println("Yes");
		else
			System.out.println("No"); judge() judge System.out.println("Yes") System.out.println System.out System System.out "Yes" System.out.println("No") System.out.println System.out System System.out "No" private boolean judge() {
		if (C[0][1] - C[0][0] != C[1][1] - C[1][0])
			return false;
		if (C[0][1] - C[0][0] != C[2][1] - C[2][0])
			return false;
		if (C[0][2] - C[0][0] != C[1][2] - C[1][0])
			return false;
		if (C[0][2] - C[0][0] != C[2][2] - C[2][0])
			return false;
		if (C[1][0] - C[0][0] != C[1][1] - C[0][1])
			return false;
		if (C[1][0] - C[0][0] != C[1][2] - C[0][2])
			return false;
		if (C[2][0] - C[0][0] != C[2][1] - C[0][1])
			return false;
		if (C[2][0] - C[0][0] != C[2][2] - C[0][2])
			return false;
		return true;
	} judge {
		if (C[0][1] - C[0][0] != C[1][1] - C[1][0])
			return false;
		if (C[0][1] - C[0][0] != C[2][1] - C[2][0])
			return false;
		if (C[0][2] - C[0][0] != C[1][2] - C[1][0])
			return false;
		if (C[0][2] - C[0][0] != C[2][2] - C[2][0])
			return false;
		if (C[1][0] - C[0][0] != C[1][1] - C[0][1])
			return false;
		if (C[1][0] - C[0][0] != C[1][2] - C[0][2])
			return false;
		if (C[2][0] - C[0][0] != C[2][1] - C[0][1])
			return false;
		if (C[2][0] - C[0][0] != C[2][2] - C[0][2])
			return false;
		return true;
	} if (C[0][1] - C[0][0] != C[1][1] - C[1][0])
			return false; C[0][1] - C[0][0] != C[1][1] - C[1][0] C[0][1] - C[0][0] C[0][1] C[0] C 0 1 C[0][0] C[0] C 0 0 C[1][1] - C[1][0] C[1][1] C[1] C 1 1 C[1][0] C[1] C 1 0 return false; false if (C[0][1] - C[0][0] != C[2][1] - C[2][0])
			return false; C[0][1] - C[0][0] != C[2][1] - C[2][0] C[0][1] - C[0][0] C[0][1] C[0] C 0 1 C[0][0] C[0] C 0 0 C[2][1] - C[2][0] C[2][1] C[2] C 2 1 C[2][0] C[2] C 2 0 return false; false if (C[0][2] - C[0][0] != C[1][2] - C[1][0])
			return false; C[0][2] - C[0][0] != C[1][2] - C[1][0] C[0][2] - C[0][0] C[0][2] C[0] C 0 2 C[0][0] C[0] C 0 0 C[1][2] - C[1][0] C[1][2] C[1] C 1 2 C[1][0] C[1] C 1 0 return false; false if (C[0][2] - C[0][0] != C[2][2] - C[2][0])
			return false; C[0][2] - C[0][0] != C[2][2] - C[2][0] C[0][2] - C[0][0] C[0][2] C[0] C 0 2 C[0][0] C[0] C 0 0 C[2][2] - C[2][0] C[2][2] C[2] C 2 2 C[2][0] C[2] C 2 0 return false; false if (C[1][0] - C[0][0] != C[1][1] - C[0][1])
			return false; C[1][0] - C[0][0] != C[1][1] - C[0][1] C[1][0] - C[0][0] C[1][0] C[1] C 1 0 C[0][0] C[0] C 0 0 C[1][1] - C[0][1] C[1][1] C[1] C 1 1 C[0][1] C[0] C 0 1 return false; false if (C[1][0] - C[0][0] != C[1][2] - C[0][2])
			return false; C[1][0] - C[0][0] != C[1][2] - C[0][2] C[1][0] - C[0][0] C[1][0] C[1] C 1 0 C[0][0] C[0] C 0 0 C[1][2] - C[0][2] C[1][2] C[1] C 1 2 C[0][2] C[0] C 0 2 return false; false if (C[2][0] - C[0][0] != C[2][1] - C[0][1])
			return false; C[2][0] - C[0][0] != C[2][1] - C[0][1] C[2][0] - C[0][0] C[2][0] C[2] C 2 0 C[0][0] C[0] C 0 0 C[2][1] - C[0][1] C[2][1] C[2] C 2 1 C[0][1] C[0] C 0 1 return false; false if (C[2][0] - C[0][0] != C[2][2] - C[0][2])
			return false; C[2][0] - C[0][0] != C[2][2] - C[0][2] C[2][0] - C[0][0] C[2][0] C[2] C 2 0 C[0][0] C[0] C 0 0 C[2][2] - C[0][2] C[2][2] C[2] C 2 2 C[0][2] C[0] C 0 2 return false; false return true; true
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {
	public static void main(String args[]) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		Solver solver = new Solver();
		solver.init();
		// solver.readHead(in.readLine());
		for (; solver.hasNext();) {
			solver.readBody(in.readLine());
		}
		solver.solve();
	}
}

class Solver {
	int N;
	int cnt;
	int[][] C;

	public void init() {
		N = 0;
		cnt = 0;
		C = new int[3][3];
	}

	public void readHead(String str) {
		String[] strArr = str.split(" ");
		N = Integer.parseInt(strArr[0]);
		// System.out.println(N);
	}

	public boolean hasNext() {
		// return cnt < N;
		return cnt < 3;
	}

	public void readBody(String str) {
		// System.out.println(str);
		String[] strArr = str.split(" ");
		for (int i = 0; i < 3; i++)
			C[cnt][i] = Integer.parseInt(strArr[i]);
		cnt++;
	}

	public void solve() {
		if (judge())
			System.out.println("Yes");
		else
			System.out.println("No");
	}

	private boolean judge() {
		if (C[0][1] - C[0][0] != C[1][1] - C[1][0])
			return false;
		if (C[0][1] - C[0][0] != C[2][1] - C[2][0])
			return false;
		if (C[0][2] - C[0][0] != C[1][2] - C[1][0])
			return false;
		if (C[0][2] - C[0][0] != C[2][2] - C[2][0])
			return false;
		if (C[1][0] - C[0][0] != C[1][1] - C[0][1])
			return false;
		if (C[1][0] - C[0][0] != C[1][2] - C[0][2])
			return false;
		if (C[2][0] - C[0][0] != C[2][1] - C[0][1])
			return false;
		if (C[2][0] - C[0][0] != C[2][2] - C[0][2])
			return false;
		return true;
	}
}
