import java.util.Scanner;

public class Main {

	final int size = 3;
	final int[][] grid = new int[size][size];
	
	public static void main(String[] args) {
		new Main().run();
	}
	
	void run() {
		Scanner sc = new Scanner(System.in);
		for(int i=0; i<size; i++)
			for(int j=0; j<size; j++) grid[i][j] = sc.nextInt();
		sc.close();
		int aAry[] = new int[size];
		int bAry[] = new int[size];
		
		for(int i=0; i <= grid[0][0]; i++) {
			aAry[0] = i;
			bAry[0] = grid[0][0] - aAry[0];
			bAry[1] = grid[0][1] - aAry[0];
			bAry[2] = grid[0][2] - aAry[0];
			aAry[1] = grid[1][0] - bAry[0];
			aAry[2] = grid[2][0] - bAry[0];
			if(judge(aAry, bAry)) {
				System.out.println("Yes");
				return;
			}
		}
		
		System.out.println("No");
	}

	boolean judge(int aAry[], int bAry[]) {
		boolean res = true;
		
		for(int i=0; i<size; i++) {
			for(int j=0; j<size; j++) {
				if(grid[i][j] != aAry[i] + bAry[j]) return false;
			}
		}
		
		return res;
	}
} import java.util.Scanner; Scanner java.util public class Main {

	final int size = 3;
	final int[][] grid = new int[size][size];
	
	public static void main(String[] args) {
		new Main().run();
	}
	
	void run() {
		Scanner sc = new Scanner(System.in);
		for(int i=0; i<size; i++)
			for(int j=0; j<size; j++) grid[i][j] = sc.nextInt();
		sc.close();
		int aAry[] = new int[size];
		int bAry[] = new int[size];
		
		for(int i=0; i <= grid[0][0]; i++) {
			aAry[0] = i;
			bAry[0] = grid[0][0] - aAry[0];
			bAry[1] = grid[0][1] - aAry[0];
			bAry[2] = grid[0][2] - aAry[0];
			aAry[1] = grid[1][0] - bAry[0];
			aAry[2] = grid[2][0] - bAry[0];
			if(judge(aAry, bAry)) {
				System.out.println("Yes");
				return;
			}
		}
		
		System.out.println("No");
	}

	boolean judge(int aAry[], int bAry[]) {
		boolean res = true;
		
		for(int i=0; i<size; i++) {
			for(int j=0; j<size; j++) {
				if(grid[i][j] != aAry[i] + bAry[j]) return false;
			}
		}
		
		return res;
	}
} Main final int size = 3; size 3 final int[][] grid = new int[size][size]; grid new int[size][size] size size public static void main(String[] args) {
		new Main().run();
	} main {
		new Main().run();
	} new Main().run() new Main().run new Main() String[] args args void run() {
		Scanner sc = new Scanner(System.in);
		for(int i=0; i<size; i++)
			for(int j=0; j<size; j++) grid[i][j] = sc.nextInt();
		sc.close();
		int aAry[] = new int[size];
		int bAry[] = new int[size];
		
		for(int i=0; i <= grid[0][0]; i++) {
			aAry[0] = i;
			bAry[0] = grid[0][0] - aAry[0];
			bAry[1] = grid[0][1] - aAry[0];
			bAry[2] = grid[0][2] - aAry[0];
			aAry[1] = grid[1][0] - bAry[0];
			aAry[2] = grid[2][0] - bAry[0];
			if(judge(aAry, bAry)) {
				System.out.println("Yes");
				return;
			}
		}
		
		System.out.println("No");
	} run {
		Scanner sc = new Scanner(System.in);
		for(int i=0; i<size; i++)
			for(int j=0; j<size; j++) grid[i][j] = sc.nextInt();
		sc.close();
		int aAry[] = new int[size];
		int bAry[] = new int[size];
		
		for(int i=0; i <= grid[0][0]; i++) {
			aAry[0] = i;
			bAry[0] = grid[0][0] - aAry[0];
			bAry[1] = grid[0][1] - aAry[0];
			bAry[2] = grid[0][2] - aAry[0];
			aAry[1] = grid[1][0] - bAry[0];
			aAry[2] = grid[2][0] - bAry[0];
			if(judge(aAry, bAry)) {
				System.out.println("Yes");
				return;
			}
		}
		
		System.out.println("No");
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) for(int i=0; i<size; i++)
			for(int j=0; j<size; j++) grid[i][j] = sc.nextInt(); int i=0; int i=0; i 0 i<size i size i++ i++ i for(int j=0; j<size; j++) grid[i][j] = sc.nextInt(); for(int j=0; j<size; j++) grid[i][j] = sc.nextInt(); int j=0; int j=0; j 0 j<size j size j++ j++ j grid[i][j] = sc.nextInt(); grid[i][j] = sc.nextInt() grid[i][j] grid[i] grid i j sc.nextInt() sc.nextInt sc sc.close() sc.close sc int aAry[] = new int[size]; aAry new int[size] size int bAry[] = new int[size]; bAry new int[size] size for(int i=0; i <= grid[0][0]; i++) {
			aAry[0] = i;
			bAry[0] = grid[0][0] - aAry[0];
			bAry[1] = grid[0][1] - aAry[0];
			bAry[2] = grid[0][2] - aAry[0];
			aAry[1] = grid[1][0] - bAry[0];
			aAry[2] = grid[2][0] - bAry[0];
			if(judge(aAry, bAry)) {
				System.out.println("Yes");
				return;
			}
		} int i=0; int i=0; i 0 i <= grid[0][0] i grid[0][0] grid[0] grid 0 0 i++ i++ i {
			aAry[0] = i;
			bAry[0] = grid[0][0] - aAry[0];
			bAry[1] = grid[0][1] - aAry[0];
			bAry[2] = grid[0][2] - aAry[0];
			aAry[1] = grid[1][0] - bAry[0];
			aAry[2] = grid[2][0] - bAry[0];
			if(judge(aAry, bAry)) {
				System.out.println("Yes");
				return;
			}
		} {
			aAry[0] = i;
			bAry[0] = grid[0][0] - aAry[0];
			bAry[1] = grid[0][1] - aAry[0];
			bAry[2] = grid[0][2] - aAry[0];
			aAry[1] = grid[1][0] - bAry[0];
			aAry[2] = grid[2][0] - bAry[0];
			if(judge(aAry, bAry)) {
				System.out.println("Yes");
				return;
			}
		} aAry[0] = i aAry[0] aAry 0 i bAry[0] = grid[0][0] - aAry[0] bAry[0] bAry 0 grid[0][0] - aAry[0] grid[0][0] grid[0] grid 0 0 aAry[0] aAry 0 bAry[1] = grid[0][1] - aAry[0] bAry[1] bAry 1 grid[0][1] - aAry[0] grid[0][1] grid[0] grid 0 1 aAry[0] aAry 0 bAry[2] = grid[0][2] - aAry[0] bAry[2] bAry 2 grid[0][2] - aAry[0] grid[0][2] grid[0] grid 0 2 aAry[0] aAry 0 aAry[1] = grid[1][0] - bAry[0] aAry[1] aAry 1 grid[1][0] - bAry[0] grid[1][0] grid[1] grid 1 0 bAry[0] bAry 0 aAry[2] = grid[2][0] - bAry[0] aAry[2] aAry 2 grid[2][0] - bAry[0] grid[2][0] grid[2] grid 2 0 bAry[0] bAry 0 if(judge(aAry, bAry)) {
				System.out.println("Yes");
				return;
			} judge(aAry, bAry) judge aAry bAry {
				System.out.println("Yes");
				return;
			} System.out.println("Yes") System.out.println System.out System System.out "Yes" return; System.out.println("No") System.out.println System.out System System.out "No" boolean judge(int aAry[], int bAry[]) {
		boolean res = true;
		
		for(int i=0; i<size; i++) {
			for(int j=0; j<size; j++) {
				if(grid[i][j] != aAry[i] + bAry[j]) return false;
			}
		}
		
		return res;
	} judge {
		boolean res = true;
		
		for(int i=0; i<size; i++) {
			for(int j=0; j<size; j++) {
				if(grid[i][j] != aAry[i] + bAry[j]) return false;
			}
		}
		
		return res;
	} boolean res = true; res true for(int i=0; i<size; i++) {
			for(int j=0; j<size; j++) {
				if(grid[i][j] != aAry[i] + bAry[j]) return false;
			}
		} int i=0; int i=0; i 0 i<size i size i++ i++ i {
			for(int j=0; j<size; j++) {
				if(grid[i][j] != aAry[i] + bAry[j]) return false;
			}
		} {
			for(int j=0; j<size; j++) {
				if(grid[i][j] != aAry[i] + bAry[j]) return false;
			}
		} for(int j=0; j<size; j++) {
				if(grid[i][j] != aAry[i] + bAry[j]) return false;
			} int j=0; int j=0; j 0 j<size j size j++ j++ j {
				if(grid[i][j] != aAry[i] + bAry[j]) return false;
			} {
				if(grid[i][j] != aAry[i] + bAry[j]) return false;
			} if(grid[i][j] != aAry[i] + bAry[j]) return false; grid[i][j] != aAry[i] + bAry[j] grid[i][j] grid[i] grid i j aAry[i] + bAry[j] aAry[i] aAry i bAry[j] bAry j return false; false return res; res int aAry[] aAry int bAry[] bAry public class Main {

	final int size = 3;
	final int[][] grid = new int[size][size];
	
	public static void main(String[] args) {
		new Main().run();
	}
	
	void run() {
		Scanner sc = new Scanner(System.in);
		for(int i=0; i<size; i++)
			for(int j=0; j<size; j++) grid[i][j] = sc.nextInt();
		sc.close();
		int aAry[] = new int[size];
		int bAry[] = new int[size];
		
		for(int i=0; i <= grid[0][0]; i++) {
			aAry[0] = i;
			bAry[0] = grid[0][0] - aAry[0];
			bAry[1] = grid[0][1] - aAry[0];
			bAry[2] = grid[0][2] - aAry[0];
			aAry[1] = grid[1][0] - bAry[0];
			aAry[2] = grid[2][0] - bAry[0];
			if(judge(aAry, bAry)) {
				System.out.println("Yes");
				return;
			}
		}
		
		System.out.println("No");
	}

	boolean judge(int aAry[], int bAry[]) {
		boolean res = true;
		
		for(int i=0; i<size; i++) {
			for(int j=0; j<size; j++) {
				if(grid[i][j] != aAry[i] + bAry[j]) return false;
			}
		}
		
		return res;
	}
} public class Main {

	final int size = 3;
	final int[][] grid = new int[size][size];
	
	public static void main(String[] args) {
		new Main().run();
	}
	
	void run() {
		Scanner sc = new Scanner(System.in);
		for(int i=0; i<size; i++)
			for(int j=0; j<size; j++) grid[i][j] = sc.nextInt();
		sc.close();
		int aAry[] = new int[size];
		int bAry[] = new int[size];
		
		for(int i=0; i <= grid[0][0]; i++) {
			aAry[0] = i;
			bAry[0] = grid[0][0] - aAry[0];
			bAry[1] = grid[0][1] - aAry[0];
			bAry[2] = grid[0][2] - aAry[0];
			aAry[1] = grid[1][0] - bAry[0];
			aAry[2] = grid[2][0] - bAry[0];
			if(judge(aAry, bAry)) {
				System.out.println("Yes");
				return;
			}
		}
		
		System.out.println("No");
	}

	boolean judge(int aAry[], int bAry[]) {
		boolean res = true;
		
		for(int i=0; i<size; i++) {
			for(int j=0; j<size; j++) {
				if(grid[i][j] != aAry[i] + bAry[j]) return false;
			}
		}
		
		return res;
	}
} Main
import java.util.Scanner;

public class Main {

	final int size = 3;
	final int[][] grid = new int[size][size];
	
	public static void main(String[] args) {
		new Main().run();
	}
	
	void run() {
		Scanner sc = new Scanner(System.in);
		for(int i=0; i<size; i++)
			for(int j=0; j<size; j++) grid[i][j] = sc.nextInt();
		sc.close();
		int aAry[] = new int[size];
		int bAry[] = new int[size];
		
		for(int i=0; i <= grid[0][0]; i++) {
			aAry[0] = i;
			bAry[0] = grid[0][0] - aAry[0];
			bAry[1] = grid[0][1] - aAry[0];
			bAry[2] = grid[0][2] - aAry[0];
			aAry[1] = grid[1][0] - bAry[0];
			aAry[2] = grid[2][0] - bAry[0];
			if(judge(aAry, bAry)) {
				System.out.println("Yes");
				return;
			}
		}
		
		System.out.println("No");
	}

	boolean judge(int aAry[], int bAry[]) {
		boolean res = true;
		
		for(int i=0; i<size; i++) {
			for(int j=0; j<size; j++) {
				if(grid[i][j] != aAry[i] + bAry[j]) return false;
			}
		}
		
		return res;
	}
}