import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {

	private static final String YES = "Yes";

	private static final String NO = "No";

	public static void main(String[] args) {

		int[][] arr = scan();
		System.out.println(process(arr) ? YES : NO);
	}

	private static int[][] scan() {

		Scanner sc = new Scanner(System.in);
		int[][] arr = new int[3][3];
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				arr[i][j] = sc.nextInt();
			}
		}
		sc.close();
		return arr;
	}

	private static boolean process(int[][] arr) {

		Map<String, Integer> map = new HashMap<>();

		return invoke(arr, map, 0);
	}

	private static boolean invoke(int[][] arr, Map<String, Integer> map, int j) {

		String aKey = "a" + j;
		int val;
		int a;
		int b;
		String bKey;
		while (j < arr.length) {
			a = arr[0][j];
			if (map.get(aKey) == null) {
				map.put(aKey, a);
			} else {
				a = map.get(aKey);
			}
			if (a < 0) {
				return false;
			}

			for (int i = 0; i < arr.length; i++) {
				val = arr[i][j];
				bKey = "b" + i;
				b = val - a;

				if (map.get(bKey) == null) {
					map.put(bKey, b);
				} else if (b != map.get(bKey)) {
					if (j > 0) {
						map.put(aKey, map.get(aKey) - 1);
						return invoke(arr, map, j);
					}
					map.put(bKey, b);
				} else {
					b = map.get(bKey);
				}

				if (b < 0 || val != (a + b)) {
					map.put(aKey, map.get(aKey) - 1);
					return invoke(arr, map, j);
				}
			}
			return invoke(arr, map, j + 1);
		}
		return true;
	}
} import java.util.HashMap; HashMap java.util import java.util.Map; Map java.util import java.util.Scanner; Scanner java.util public class Main {

	private static final String YES = "Yes";

	private static final String NO = "No";

	public static void main(String[] args) {

		int[][] arr = scan();
		System.out.println(process(arr) ? YES : NO);
	}

	private static int[][] scan() {

		Scanner sc = new Scanner(System.in);
		int[][] arr = new int[3][3];
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				arr[i][j] = sc.nextInt();
			}
		}
		sc.close();
		return arr;
	}

	private static boolean process(int[][] arr) {

		Map<String, Integer> map = new HashMap<>();

		return invoke(arr, map, 0);
	}

	private static boolean invoke(int[][] arr, Map<String, Integer> map, int j) {

		String aKey = "a" + j;
		int val;
		int a;
		int b;
		String bKey;
		while (j < arr.length) {
			a = arr[0][j];
			if (map.get(aKey) == null) {
				map.put(aKey, a);
			} else {
				a = map.get(aKey);
			}
			if (a < 0) {
				return false;
			}

			for (int i = 0; i < arr.length; i++) {
				val = arr[i][j];
				bKey = "b" + i;
				b = val - a;

				if (map.get(bKey) == null) {
					map.put(bKey, b);
				} else if (b != map.get(bKey)) {
					if (j > 0) {
						map.put(aKey, map.get(aKey) - 1);
						return invoke(arr, map, j);
					}
					map.put(bKey, b);
				} else {
					b = map.get(bKey);
				}

				if (b < 0 || val != (a + b)) {
					map.put(aKey, map.get(aKey) - 1);
					return invoke(arr, map, j);
				}
			}
			return invoke(arr, map, j + 1);
		}
		return true;
	}
} Main private static final String YES = "Yes"; YES "Yes" private static final String NO = "No"; NO "No" public static void main(String[] args) {

		int[][] arr = scan();
		System.out.println(process(arr) ? YES : NO);
	} main {

		int[][] arr = scan();
		System.out.println(process(arr) ? YES : NO);
	} int[][] arr = scan(); arr scan() scan System.out.println(process(arr) ? YES : NO) System.out.println System.out System System.out process(arr) ? YES : NO process(arr) process arr YES NO String[] args args private static int[][] scan() {

		Scanner sc = new Scanner(System.in);
		int[][] arr = new int[3][3];
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				arr[i][j] = sc.nextInt();
			}
		}
		sc.close();
		return arr;
	} scan {

		Scanner sc = new Scanner(System.in);
		int[][] arr = new int[3][3];
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				arr[i][j] = sc.nextInt();
			}
		}
		sc.close();
		return arr;
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[][] arr = new int[3][3]; arr new int[3][3] 3 3 for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				arr[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++) {
				arr[i][j] = sc.nextInt();
			}
		} {
			for (int j = 0; j < 3; j++) {
				arr[i][j] = sc.nextInt();
			}
		} for (int j = 0; j < 3; j++) {
				arr[i][j] = sc.nextInt();
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				arr[i][j] = sc.nextInt();
			} {
				arr[i][j] = sc.nextInt();
			} arr[i][j] = sc.nextInt() arr[i][j] arr[i] arr i j sc.nextInt() sc.nextInt sc sc.close() sc.close sc return arr; arr private static boolean process(int[][] arr) {

		Map<String, Integer> map = new HashMap<>();

		return invoke(arr, map, 0);
	} process {

		Map<String, Integer> map = new HashMap<>();

		return invoke(arr, map, 0);
	} Map<String, Integer> map = new HashMap<>(); map new HashMap<>() return invoke(arr, map, 0); invoke(arr, map, 0) invoke arr map 0 int[][] arr arr private static boolean invoke(int[][] arr, Map<String, Integer> map, int j) {

		String aKey = "a" + j;
		int val;
		int a;
		int b;
		String bKey;
		while (j < arr.length) {
			a = arr[0][j];
			if (map.get(aKey) == null) {
				map.put(aKey, a);
			} else {
				a = map.get(aKey);
			}
			if (a < 0) {
				return false;
			}

			for (int i = 0; i < arr.length; i++) {
				val = arr[i][j];
				bKey = "b" + i;
				b = val - a;

				if (map.get(bKey) == null) {
					map.put(bKey, b);
				} else if (b != map.get(bKey)) {
					if (j > 0) {
						map.put(aKey, map.get(aKey) - 1);
						return invoke(arr, map, j);
					}
					map.put(bKey, b);
				} else {
					b = map.get(bKey);
				}

				if (b < 0 || val != (a + b)) {
					map.put(aKey, map.get(aKey) - 1);
					return invoke(arr, map, j);
				}
			}
			return invoke(arr, map, j + 1);
		}
		return true;
	} invoke {

		String aKey = "a" + j;
		int val;
		int a;
		int b;
		String bKey;
		while (j < arr.length) {
			a = arr[0][j];
			if (map.get(aKey) == null) {
				map.put(aKey, a);
			} else {
				a = map.get(aKey);
			}
			if (a < 0) {
				return false;
			}

			for (int i = 0; i < arr.length; i++) {
				val = arr[i][j];
				bKey = "b" + i;
				b = val - a;

				if (map.get(bKey) == null) {
					map.put(bKey, b);
				} else if (b != map.get(bKey)) {
					if (j > 0) {
						map.put(aKey, map.get(aKey) - 1);
						return invoke(arr, map, j);
					}
					map.put(bKey, b);
				} else {
					b = map.get(bKey);
				}

				if (b < 0 || val != (a + b)) {
					map.put(aKey, map.get(aKey) - 1);
					return invoke(arr, map, j);
				}
			}
			return invoke(arr, map, j + 1);
		}
		return true;
	} String aKey = "a" + j; aKey "a" + j "a" j int val; val int a; a int b; b String bKey; bKey while (j < arr.length) {
			a = arr[0][j];
			if (map.get(aKey) == null) {
				map.put(aKey, a);
			} else {
				a = map.get(aKey);
			}
			if (a < 0) {
				return false;
			}

			for (int i = 0; i < arr.length; i++) {
				val = arr[i][j];
				bKey = "b" + i;
				b = val - a;

				if (map.get(bKey) == null) {
					map.put(bKey, b);
				} else if (b != map.get(bKey)) {
					if (j > 0) {
						map.put(aKey, map.get(aKey) - 1);
						return invoke(arr, map, j);
					}
					map.put(bKey, b);
				} else {
					b = map.get(bKey);
				}

				if (b < 0 || val != (a + b)) {
					map.put(aKey, map.get(aKey) - 1);
					return invoke(arr, map, j);
				}
			}
			return invoke(arr, map, j + 1);
		} j < arr.length j arr.length arr arr.length {
			a = arr[0][j];
			if (map.get(aKey) == null) {
				map.put(aKey, a);
			} else {
				a = map.get(aKey);
			}
			if (a < 0) {
				return false;
			}

			for (int i = 0; i < arr.length; i++) {
				val = arr[i][j];
				bKey = "b" + i;
				b = val - a;

				if (map.get(bKey) == null) {
					map.put(bKey, b);
				} else if (b != map.get(bKey)) {
					if (j > 0) {
						map.put(aKey, map.get(aKey) - 1);
						return invoke(arr, map, j);
					}
					map.put(bKey, b);
				} else {
					b = map.get(bKey);
				}

				if (b < 0 || val != (a + b)) {
					map.put(aKey, map.get(aKey) - 1);
					return invoke(arr, map, j);
				}
			}
			return invoke(arr, map, j + 1);
		} a = arr[0][j] a arr[0][j] arr[0] arr 0 j if (map.get(aKey) == null) {
				map.put(aKey, a);
			} else {
				a = map.get(aKey);
			} map.get(aKey) == null map.get(aKey) map.get map aKey null {
				map.put(aKey, a);
			} map.put(aKey, a) map.put map aKey a {
				a = map.get(aKey);
			} a = map.get(aKey) a map.get(aKey) map.get map aKey if (a < 0) {
				return false;
			} a < 0 a 0 {
				return false;
			} return false; false for (int i = 0; i < arr.length; i++) {
				val = arr[i][j];
				bKey = "b" + i;
				b = val - a;

				if (map.get(bKey) == null) {
					map.put(bKey, b);
				} else if (b != map.get(bKey)) {
					if (j > 0) {
						map.put(aKey, map.get(aKey) - 1);
						return invoke(arr, map, j);
					}
					map.put(bKey, b);
				} else {
					b = map.get(bKey);
				}

				if (b < 0 || val != (a + b)) {
					map.put(aKey, map.get(aKey) - 1);
					return invoke(arr, map, j);
				}
			} int i = 0; int i = 0; i 0 i < arr.length i arr.length arr arr.length i++ i++ i {
				val = arr[i][j];
				bKey = "b" + i;
				b = val - a;

				if (map.get(bKey) == null) {
					map.put(bKey, b);
				} else if (b != map.get(bKey)) {
					if (j > 0) {
						map.put(aKey, map.get(aKey) - 1);
						return invoke(arr, map, j);
					}
					map.put(bKey, b);
				} else {
					b = map.get(bKey);
				}

				if (b < 0 || val != (a + b)) {
					map.put(aKey, map.get(aKey) - 1);
					return invoke(arr, map, j);
				}
			} {
				val = arr[i][j];
				bKey = "b" + i;
				b = val - a;

				if (map.get(bKey) == null) {
					map.put(bKey, b);
				} else if (b != map.get(bKey)) {
					if (j > 0) {
						map.put(aKey, map.get(aKey) - 1);
						return invoke(arr, map, j);
					}
					map.put(bKey, b);
				} else {
					b = map.get(bKey);
				}

				if (b < 0 || val != (a + b)) {
					map.put(aKey, map.get(aKey) - 1);
					return invoke(arr, map, j);
				}
			} val = arr[i][j] val arr[i][j] arr[i] arr i j bKey = "b" + i bKey "b" + i "b" i b = val - a b val - a val a if (map.get(bKey) == null) {
					map.put(bKey, b);
				} else if (b != map.get(bKey)) {
					if (j > 0) {
						map.put(aKey, map.get(aKey) - 1);
						return invoke(arr, map, j);
					}
					map.put(bKey, b);
				} else {
					b = map.get(bKey);
				} map.get(bKey) == null map.get(bKey) map.get map bKey null {
					map.put(bKey, b);
				} map.put(bKey, b) map.put map bKey b if (b != map.get(bKey)) {
					if (j > 0) {
						map.put(aKey, map.get(aKey) - 1);
						return invoke(arr, map, j);
					}
					map.put(bKey, b);
				} else {
					b = map.get(bKey);
				} b != map.get(bKey) b map.get(bKey) map.get map bKey {
					if (j > 0) {
						map.put(aKey, map.get(aKey) - 1);
						return invoke(arr, map, j);
					}
					map.put(bKey, b);
				} if (j > 0) {
						map.put(aKey, map.get(aKey) - 1);
						return invoke(arr, map, j);
					} j > 0 j 0 {
						map.put(aKey, map.get(aKey) - 1);
						return invoke(arr, map, j);
					} map.put(aKey, map.get(aKey) - 1) map.put map aKey map.get(aKey) - 1 map.get(aKey) map.get map aKey 1 return invoke(arr, map, j); invoke(arr, map, j) invoke arr map j map.put(bKey, b) map.put map bKey b {
					b = map.get(bKey);
				} b = map.get(bKey) b map.get(bKey) map.get map bKey if (b < 0 || val != (a + b)) {
					map.put(aKey, map.get(aKey) - 1);
					return invoke(arr, map, j);
				} b < 0 || val != (a + b) b < 0 b 0 val != (a + b) val (a + b) a b {
					map.put(aKey, map.get(aKey) - 1);
					return invoke(arr, map, j);
				} map.put(aKey, map.get(aKey) - 1) map.put map aKey map.get(aKey) - 1 map.get(aKey) map.get map aKey 1 return invoke(arr, map, j); invoke(arr, map, j) invoke arr map j return invoke(arr, map, j + 1); invoke(arr, map, j + 1) invoke arr map j + 1 j 1 return true; true int[][] arr arr Map<String, Integer> map map int j j public class Main {

	private static final String YES = "Yes";

	private static final String NO = "No";

	public static void main(String[] args) {

		int[][] arr = scan();
		System.out.println(process(arr) ? YES : NO);
	}

	private static int[][] scan() {

		Scanner sc = new Scanner(System.in);
		int[][] arr = new int[3][3];
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				arr[i][j] = sc.nextInt();
			}
		}
		sc.close();
		return arr;
	}

	private static boolean process(int[][] arr) {

		Map<String, Integer> map = new HashMap<>();

		return invoke(arr, map, 0);
	}

	private static boolean invoke(int[][] arr, Map<String, Integer> map, int j) {

		String aKey = "a" + j;
		int val;
		int a;
		int b;
		String bKey;
		while (j < arr.length) {
			a = arr[0][j];
			if (map.get(aKey) == null) {
				map.put(aKey, a);
			} else {
				a = map.get(aKey);
			}
			if (a < 0) {
				return false;
			}

			for (int i = 0; i < arr.length; i++) {
				val = arr[i][j];
				bKey = "b" + i;
				b = val - a;

				if (map.get(bKey) == null) {
					map.put(bKey, b);
				} else if (b != map.get(bKey)) {
					if (j > 0) {
						map.put(aKey, map.get(aKey) - 1);
						return invoke(arr, map, j);
					}
					map.put(bKey, b);
				} else {
					b = map.get(bKey);
				}

				if (b < 0 || val != (a + b)) {
					map.put(aKey, map.get(aKey) - 1);
					return invoke(arr, map, j);
				}
			}
			return invoke(arr, map, j + 1);
		}
		return true;
	}
} public class Main {

	private static final String YES = "Yes";

	private static final String NO = "No";

	public static void main(String[] args) {

		int[][] arr = scan();
		System.out.println(process(arr) ? YES : NO);
	}

	private static int[][] scan() {

		Scanner sc = new Scanner(System.in);
		int[][] arr = new int[3][3];
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				arr[i][j] = sc.nextInt();
			}
		}
		sc.close();
		return arr;
	}

	private static boolean process(int[][] arr) {

		Map<String, Integer> map = new HashMap<>();

		return invoke(arr, map, 0);
	}

	private static boolean invoke(int[][] arr, Map<String, Integer> map, int j) {

		String aKey = "a" + j;
		int val;
		int a;
		int b;
		String bKey;
		while (j < arr.length) {
			a = arr[0][j];
			if (map.get(aKey) == null) {
				map.put(aKey, a);
			} else {
				a = map.get(aKey);
			}
			if (a < 0) {
				return false;
			}

			for (int i = 0; i < arr.length; i++) {
				val = arr[i][j];
				bKey = "b" + i;
				b = val - a;

				if (map.get(bKey) == null) {
					map.put(bKey, b);
				} else if (b != map.get(bKey)) {
					if (j > 0) {
						map.put(aKey, map.get(aKey) - 1);
						return invoke(arr, map, j);
					}
					map.put(bKey, b);
				} else {
					b = map.get(bKey);
				}

				if (b < 0 || val != (a + b)) {
					map.put(aKey, map.get(aKey) - 1);
					return invoke(arr, map, j);
				}
			}
			return invoke(arr, map, j + 1);
		}
		return true;
	}
} Main
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {

	private static final String YES = "Yes";

	private static final String NO = "No";

	public static void main(String[] args) {

		int[][] arr = scan();
		System.out.println(process(arr) ? YES : NO);
	}

	private static int[][] scan() {

		Scanner sc = new Scanner(System.in);
		int[][] arr = new int[3][3];
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				arr[i][j] = sc.nextInt();
			}
		}
		sc.close();
		return arr;
	}

	private static boolean process(int[][] arr) {

		Map<String, Integer> map = new HashMap<>();

		return invoke(arr, map, 0);
	}

	private static boolean invoke(int[][] arr, Map<String, Integer> map, int j) {

		String aKey = "a" + j;
		int val;
		int a;
		int b;
		String bKey;
		while (j < arr.length) {
			a = arr[0][j];
			if (map.get(aKey) == null) {
				map.put(aKey, a);
			} else {
				a = map.get(aKey);
			}
			if (a < 0) {
				return false;
			}

			for (int i = 0; i < arr.length; i++) {
				val = arr[i][j];
				bKey = "b" + i;
				b = val - a;

				if (map.get(bKey) == null) {
					map.put(bKey, b);
				} else if (b != map.get(bKey)) {
					if (j > 0) {
						map.put(aKey, map.get(aKey) - 1);
						return invoke(arr, map, j);
					}
					map.put(bKey, b);
				} else {
					b = map.get(bKey);
				}

				if (b < 0 || val != (a + b)) {
					map.put(aKey, map.get(aKey) - 1);
					return invoke(arr, map, j);
				}
			}
			return invoke(arr, map, j + 1);
		}
		return true;
	}
}