import java.util.*;

public class Main {
	public static void main(String[] args) {
		new Main().execute();
	}

	public void execute() {
		Scanner sc = new Scanner(System.in);
		int[][] board = new int[3][3];

		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				board[i][j] = sc.nextInt();
			}
		}

		if (check(board)) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
		sc.close();
	}

	private boolean check(int[][] board) {
		if (board.length != 3 || board[0].length != 3) {
			throw new IllegalArgumentException();
		}
		boolean check = false;
		for (int i = 0; i < 100; i++) {
			int a1 = i;

			int b1 = board[0][0] - a1;
			int b2 = board[0][1] - a1;
			int b3 = board[0][2] - a1;
			if (withoutRange(b1) || withoutRange(b2) || withoutRange(b3)) {
				continue;
			}
			int a2 = board[1][0] - b1;
			if (withoutRange(a2) || (board[1][1] - b2) != a2 || (board[1][2] - b3) != a2) {
				continue;
			}
			int a3 = board[2][0] - b1;
			if (withoutRange(a3) || (board[2][1] -b2) != a3 || (board[2][2] - b3) != a3) {
				continue;
			}
			
			check = true;
			break;
		}
		return check;
	}

	private boolean withoutRange(int x) {
		return (x < 0 && x > 100);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		new Main().execute();
	}

	public void execute() {
		Scanner sc = new Scanner(System.in);
		int[][] board = new int[3][3];

		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				board[i][j] = sc.nextInt();
			}
		}

		if (check(board)) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
		sc.close();
	}

	private boolean check(int[][] board) {
		if (board.length != 3 || board[0].length != 3) {
			throw new IllegalArgumentException();
		}
		boolean check = false;
		for (int i = 0; i < 100; i++) {
			int a1 = i;

			int b1 = board[0][0] - a1;
			int b2 = board[0][1] - a1;
			int b3 = board[0][2] - a1;
			if (withoutRange(b1) || withoutRange(b2) || withoutRange(b3)) {
				continue;
			}
			int a2 = board[1][0] - b1;
			if (withoutRange(a2) || (board[1][1] - b2) != a2 || (board[1][2] - b3) != a2) {
				continue;
			}
			int a3 = board[2][0] - b1;
			if (withoutRange(a3) || (board[2][1] -b2) != a3 || (board[2][2] - b3) != a3) {
				continue;
			}
			
			check = true;
			break;
		}
		return check;
	}

	private boolean withoutRange(int x) {
		return (x < 0 && x > 100);
	}
} Main public static void main(String[] args) {
		new Main().execute();
	} main {
		new Main().execute();
	} new Main().execute() new Main().execute new Main() String[] args args public void execute() {
		Scanner sc = new Scanner(System.in);
		int[][] board = new int[3][3];

		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				board[i][j] = sc.nextInt();
			}
		}

		if (check(board)) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
		sc.close();
	} execute {
		Scanner sc = new Scanner(System.in);
		int[][] board = new int[3][3];

		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				board[i][j] = sc.nextInt();
			}
		}

		if (check(board)) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[][] board = new int[3][3]; board new int[3][3] 3 3 for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				board[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++) {
				board[i][j] = sc.nextInt();
			}
		} {
			for (int j = 0; j < 3; j++) {
				board[i][j] = sc.nextInt();
			}
		} for (int j = 0; j < 3; j++) {
				board[i][j] = sc.nextInt();
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				board[i][j] = sc.nextInt();
			} {
				board[i][j] = sc.nextInt();
			} board[i][j] = sc.nextInt() board[i][j] board[i] board i j sc.nextInt() sc.nextInt sc if (check(board)) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		} check(board) check board {
			System.out.println("Yes");
		} System.out.println("Yes") System.out.println System.out System System.out "Yes" {
			System.out.println("No");
		} System.out.println("No") System.out.println System.out System System.out "No" sc.close() sc.close sc private boolean check(int[][] board) {
		if (board.length != 3 || board[0].length != 3) {
			throw new IllegalArgumentException();
		}
		boolean check = false;
		for (int i = 0; i < 100; i++) {
			int a1 = i;

			int b1 = board[0][0] - a1;
			int b2 = board[0][1] - a1;
			int b3 = board[0][2] - a1;
			if (withoutRange(b1) || withoutRange(b2) || withoutRange(b3)) {
				continue;
			}
			int a2 = board[1][0] - b1;
			if (withoutRange(a2) || (board[1][1] - b2) != a2 || (board[1][2] - b3) != a2) {
				continue;
			}
			int a3 = board[2][0] - b1;
			if (withoutRange(a3) || (board[2][1] -b2) != a3 || (board[2][2] - b3) != a3) {
				continue;
			}
			
			check = true;
			break;
		}
		return check;
	} check {
		if (board.length != 3 || board[0].length != 3) {
			throw new IllegalArgumentException();
		}
		boolean check = false;
		for (int i = 0; i < 100; i++) {
			int a1 = i;

			int b1 = board[0][0] - a1;
			int b2 = board[0][1] - a1;
			int b3 = board[0][2] - a1;
			if (withoutRange(b1) || withoutRange(b2) || withoutRange(b3)) {
				continue;
			}
			int a2 = board[1][0] - b1;
			if (withoutRange(a2) || (board[1][1] - b2) != a2 || (board[1][2] - b3) != a2) {
				continue;
			}
			int a3 = board[2][0] - b1;
			if (withoutRange(a3) || (board[2][1] -b2) != a3 || (board[2][2] - b3) != a3) {
				continue;
			}
			
			check = true;
			break;
		}
		return check;
	} if (board.length != 3 || board[0].length != 3) {
			throw new IllegalArgumentException();
		} board.length != 3 || board[0].length != 3 board.length != 3 board.length board board.length 3 board[0].length != 3 board[0].length board[0] board 0 board[0].length 3 {
			throw new IllegalArgumentException();
		} throw new IllegalArgumentException(); new IllegalArgumentException() boolean check = false; check false for (int i = 0; i < 100; i++) {
			int a1 = i;

			int b1 = board[0][0] - a1;
			int b2 = board[0][1] - a1;
			int b3 = board[0][2] - a1;
			if (withoutRange(b1) || withoutRange(b2) || withoutRange(b3)) {
				continue;
			}
			int a2 = board[1][0] - b1;
			if (withoutRange(a2) || (board[1][1] - b2) != a2 || (board[1][2] - b3) != a2) {
				continue;
			}
			int a3 = board[2][0] - b1;
			if (withoutRange(a3) || (board[2][1] -b2) != a3 || (board[2][2] - b3) != a3) {
				continue;
			}
			
			check = true;
			break;
		} int i = 0; int i = 0; i 0 i < 100 i 100 i++ i++ i {
			int a1 = i;

			int b1 = board[0][0] - a1;
			int b2 = board[0][1] - a1;
			int b3 = board[0][2] - a1;
			if (withoutRange(b1) || withoutRange(b2) || withoutRange(b3)) {
				continue;
			}
			int a2 = board[1][0] - b1;
			if (withoutRange(a2) || (board[1][1] - b2) != a2 || (board[1][2] - b3) != a2) {
				continue;
			}
			int a3 = board[2][0] - b1;
			if (withoutRange(a3) || (board[2][1] -b2) != a3 || (board[2][2] - b3) != a3) {
				continue;
			}
			
			check = true;
			break;
		} {
			int a1 = i;

			int b1 = board[0][0] - a1;
			int b2 = board[0][1] - a1;
			int b3 = board[0][2] - a1;
			if (withoutRange(b1) || withoutRange(b2) || withoutRange(b3)) {
				continue;
			}
			int a2 = board[1][0] - b1;
			if (withoutRange(a2) || (board[1][1] - b2) != a2 || (board[1][2] - b3) != a2) {
				continue;
			}
			int a3 = board[2][0] - b1;
			if (withoutRange(a3) || (board[2][1] -b2) != a3 || (board[2][2] - b3) != a3) {
				continue;
			}
			
			check = true;
			break;
		} int a1 = i; a1 i int b1 = board[0][0] - a1; b1 board[0][0] - a1 board[0][0] board[0] board 0 0 a1 int b2 = board[0][1] - a1; b2 board[0][1] - a1 board[0][1] board[0] board 0 1 a1 int b3 = board[0][2] - a1; b3 board[0][2] - a1 board[0][2] board[0] board 0 2 a1 if (withoutRange(b1) || withoutRange(b2) || withoutRange(b3)) {
				continue;
			} withoutRange(b1) || withoutRange(b2) || withoutRange(b3) withoutRange(b1) || withoutRange(b2) || withoutRange(b3) withoutRange(b1) withoutRange b1 withoutRange(b2) withoutRange b2 withoutRange(b3) withoutRange b3 {
				continue;
			} continue; int a2 = board[1][0] - b1; a2 board[1][0] - b1 board[1][0] board[1] board 1 0 b1 if (withoutRange(a2) || (board[1][1] - b2) != a2 || (board[1][2] - b3) != a2) {
				continue;
			} withoutRange(a2) || (board[1][1] - b2) != a2 || (board[1][2] - b3) != a2 withoutRange(a2) || (board[1][1] - b2) != a2 || (board[1][2] - b3) != a2 withoutRange(a2) withoutRange a2 (board[1][1] - b2) != a2 (board[1][1] - b2) board[1][1] board[1] board 1 1 b2 a2 (board[1][2] - b3) != a2 (board[1][2] - b3) board[1][2] board[1] board 1 2 b3 a2 {
				continue;
			} continue; int a3 = board[2][0] - b1; a3 board[2][0] - b1 board[2][0] board[2] board 2 0 b1 if (withoutRange(a3) || (board[2][1] -b2) != a3 || (board[2][2] - b3) != a3) {
				continue;
			} withoutRange(a3) || (board[2][1] -b2) != a3 || (board[2][2] - b3) != a3 withoutRange(a3) || (board[2][1] -b2) != a3 || (board[2][2] - b3) != a3 withoutRange(a3) withoutRange a3 (board[2][1] -b2) != a3 (board[2][1] -b2) board[2][1] board[2] board 2 1 b2 a3 (board[2][2] - b3) != a3 (board[2][2] - b3) board[2][2] board[2] board 2 2 b3 a3 {
				continue;
			} continue; check = true check true break; return check; check int[][] board board private boolean withoutRange(int x) {
		return (x < 0 && x > 100);
	} withoutRange {
		return (x < 0 && x > 100);
	} return (x < 0 && x > 100); (x < 0 && x > 100) x < 0 x 0 x > 100 x 100 int x x public class Main {
	public static void main(String[] args) {
		new Main().execute();
	}

	public void execute() {
		Scanner sc = new Scanner(System.in);
		int[][] board = new int[3][3];

		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				board[i][j] = sc.nextInt();
			}
		}

		if (check(board)) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
		sc.close();
	}

	private boolean check(int[][] board) {
		if (board.length != 3 || board[0].length != 3) {
			throw new IllegalArgumentException();
		}
		boolean check = false;
		for (int i = 0; i < 100; i++) {
			int a1 = i;

			int b1 = board[0][0] - a1;
			int b2 = board[0][1] - a1;
			int b3 = board[0][2] - a1;
			if (withoutRange(b1) || withoutRange(b2) || withoutRange(b3)) {
				continue;
			}
			int a2 = board[1][0] - b1;
			if (withoutRange(a2) || (board[1][1] - b2) != a2 || (board[1][2] - b3) != a2) {
				continue;
			}
			int a3 = board[2][0] - b1;
			if (withoutRange(a3) || (board[2][1] -b2) != a3 || (board[2][2] - b3) != a3) {
				continue;
			}
			
			check = true;
			break;
		}
		return check;
	}

	private boolean withoutRange(int x) {
		return (x < 0 && x > 100);
	}
} public class Main {
	public static void main(String[] args) {
		new Main().execute();
	}

	public void execute() {
		Scanner sc = new Scanner(System.in);
		int[][] board = new int[3][3];

		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				board[i][j] = sc.nextInt();
			}
		}

		if (check(board)) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
		sc.close();
	}

	private boolean check(int[][] board) {
		if (board.length != 3 || board[0].length != 3) {
			throw new IllegalArgumentException();
		}
		boolean check = false;
		for (int i = 0; i < 100; i++) {
			int a1 = i;

			int b1 = board[0][0] - a1;
			int b2 = board[0][1] - a1;
			int b3 = board[0][2] - a1;
			if (withoutRange(b1) || withoutRange(b2) || withoutRange(b3)) {
				continue;
			}
			int a2 = board[1][0] - b1;
			if (withoutRange(a2) || (board[1][1] - b2) != a2 || (board[1][2] - b3) != a2) {
				continue;
			}
			int a3 = board[2][0] - b1;
			if (withoutRange(a3) || (board[2][1] -b2) != a3 || (board[2][2] - b3) != a3) {
				continue;
			}
			
			check = true;
			break;
		}
		return check;
	}

	private boolean withoutRange(int x) {
		return (x < 0 && x > 100);
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
		new Main().execute();
	}

	public void execute() {
		Scanner sc = new Scanner(System.in);
		int[][] board = new int[3][3];

		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				board[i][j] = sc.nextInt();
			}
		}

		if (check(board)) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
		sc.close();
	}

	private boolean check(int[][] board) {
		if (board.length != 3 || board[0].length != 3) {
			throw new IllegalArgumentException();
		}
		boolean check = false;
		for (int i = 0; i < 100; i++) {
			int a1 = i;

			int b1 = board[0][0] - a1;
			int b2 = board[0][1] - a1;
			int b3 = board[0][2] - a1;
			if (withoutRange(b1) || withoutRange(b2) || withoutRange(b3)) {
				continue;
			}
			int a2 = board[1][0] - b1;
			if (withoutRange(a2) || (board[1][1] - b2) != a2 || (board[1][2] - b3) != a2) {
				continue;
			}
			int a3 = board[2][0] - b1;
			if (withoutRange(a3) || (board[2][1] -b2) != a3 || (board[2][2] - b3) != a3) {
				continue;
			}
			
			check = true;
			break;
		}
		return check;
	}

	private boolean withoutRange(int x) {
		return (x < 0 && x > 100);
	}
}