
import java.util.Scanner;

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

	public void run() {
		Scanner sc = new Scanner(System.in);
		int g[][] = new int[3][3];
		for(int i=0; i<3; i++) {
			for(int j=0; j<3; j++) {
				g[i][j]=sc.nextInt();
			}
		}
		boolean ok = false;
		for(int i=0; i<=100; i++) {

			int a1=i;
			int b1=g[0][0]-a1;

			int b2=g[0][1]-a1;
			int b3=g[0][2]-a1;
			int a2=g[1][0]-b1;
			int a3=g[2][0]-b1;

			if( g[0][0] == a1+b1 &&
				g[0][1] == a1+b2 &&
				g[0][2] == a1+b3 &&
				g[1][0] == a2+b1 &&
				g[1][1] == a2+b2 &&
				g[1][2] == a2+b3 &&
				g[2][0] == a3+b1 &&
				g[2][1] == a3+b2 &&
				g[2][2] == a3+b3) {
				ok=true;
				break;
			}
		}
		if(ok)System.out.println("Yes");
		else System.out.println("No");
		sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}

	public void run() {
		Scanner sc = new Scanner(System.in);
		int g[][] = new int[3][3];
		for(int i=0; i<3; i++) {
			for(int j=0; j<3; j++) {
				g[i][j]=sc.nextInt();
			}
		}
		boolean ok = false;
		for(int i=0; i<=100; i++) {

			int a1=i;
			int b1=g[0][0]-a1;

			int b2=g[0][1]-a1;
			int b3=g[0][2]-a1;
			int a2=g[1][0]-b1;
			int a3=g[2][0]-b1;

			if( g[0][0] == a1+b1 &&
				g[0][1] == a1+b2 &&
				g[0][2] == a1+b3 &&
				g[1][0] == a2+b1 &&
				g[1][1] == a2+b2 &&
				g[1][2] == a2+b3 &&
				g[2][0] == a3+b1 &&
				g[2][1] == a3+b2 &&
				g[2][2] == a3+b3) {
				ok=true;
				break;
			}
		}
		if(ok)System.out.println("Yes");
		else System.out.println("No");
		sc.close();
	}
} Main public static void main(String[] args) {
		Main main = new Main();
		main.run();
	} main {
		Main main = new Main();
		main.run();
	} Main main = new Main(); main new Main() main.run() main.run main String[] args args public void run() {
		Scanner sc = new Scanner(System.in);
		int g[][] = new int[3][3];
		for(int i=0; i<3; i++) {
			for(int j=0; j<3; j++) {
				g[i][j]=sc.nextInt();
			}
		}
		boolean ok = false;
		for(int i=0; i<=100; i++) {

			int a1=i;
			int b1=g[0][0]-a1;

			int b2=g[0][1]-a1;
			int b3=g[0][2]-a1;
			int a2=g[1][0]-b1;
			int a3=g[2][0]-b1;

			if( g[0][0] == a1+b1 &&
				g[0][1] == a1+b2 &&
				g[0][2] == a1+b3 &&
				g[1][0] == a2+b1 &&
				g[1][1] == a2+b2 &&
				g[1][2] == a2+b3 &&
				g[2][0] == a3+b1 &&
				g[2][1] == a3+b2 &&
				g[2][2] == a3+b3) {
				ok=true;
				break;
			}
		}
		if(ok)System.out.println("Yes");
		else System.out.println("No");
		sc.close();
	} run {
		Scanner sc = new Scanner(System.in);
		int g[][] = new int[3][3];
		for(int i=0; i<3; i++) {
			for(int j=0; j<3; j++) {
				g[i][j]=sc.nextInt();
			}
		}
		boolean ok = false;
		for(int i=0; i<=100; i++) {

			int a1=i;
			int b1=g[0][0]-a1;

			int b2=g[0][1]-a1;
			int b3=g[0][2]-a1;
			int a2=g[1][0]-b1;
			int a3=g[2][0]-b1;

			if( g[0][0] == a1+b1 &&
				g[0][1] == a1+b2 &&
				g[0][2] == a1+b3 &&
				g[1][0] == a2+b1 &&
				g[1][1] == a2+b2 &&
				g[1][2] == a2+b3 &&
				g[2][0] == a3+b1 &&
				g[2][1] == a3+b2 &&
				g[2][2] == a3+b3) {
				ok=true;
				break;
			}
		}
		if(ok)System.out.println("Yes");
		else System.out.println("No");
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int g[][] = new int[3][3]; g new int[3][3] 3 3 for(int i=0; i<3; i++) {
			for(int j=0; j<3; j++) {
				g[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++) {
				g[i][j]=sc.nextInt();
			}
		} {
			for(int j=0; j<3; j++) {
				g[i][j]=sc.nextInt();
			}
		} for(int j=0; j<3; j++) {
				g[i][j]=sc.nextInt();
			} int j=0; int j=0; j 0 j<3 j 3 j++ j++ j {
				g[i][j]=sc.nextInt();
			} {
				g[i][j]=sc.nextInt();
			} g[i][j]=sc.nextInt() g[i][j] g[i] g i j sc.nextInt() sc.nextInt sc boolean ok = false; ok false for(int i=0; i<=100; i++) {

			int a1=i;
			int b1=g[0][0]-a1;

			int b2=g[0][1]-a1;
			int b3=g[0][2]-a1;
			int a2=g[1][0]-b1;
			int a3=g[2][0]-b1;

			if( g[0][0] == a1+b1 &&
				g[0][1] == a1+b2 &&
				g[0][2] == a1+b3 &&
				g[1][0] == a2+b1 &&
				g[1][1] == a2+b2 &&
				g[1][2] == a2+b3 &&
				g[2][0] == a3+b1 &&
				g[2][1] == a3+b2 &&
				g[2][2] == a3+b3) {
				ok=true;
				break;
			}
		} int i=0; int i=0; i 0 i<=100 i 100 i++ i++ i {

			int a1=i;
			int b1=g[0][0]-a1;

			int b2=g[0][1]-a1;
			int b3=g[0][2]-a1;
			int a2=g[1][0]-b1;
			int a3=g[2][0]-b1;

			if( g[0][0] == a1+b1 &&
				g[0][1] == a1+b2 &&
				g[0][2] == a1+b3 &&
				g[1][0] == a2+b1 &&
				g[1][1] == a2+b2 &&
				g[1][2] == a2+b3 &&
				g[2][0] == a3+b1 &&
				g[2][1] == a3+b2 &&
				g[2][2] == a3+b3) {
				ok=true;
				break;
			}
		} {

			int a1=i;
			int b1=g[0][0]-a1;

			int b2=g[0][1]-a1;
			int b3=g[0][2]-a1;
			int a2=g[1][0]-b1;
			int a3=g[2][0]-b1;

			if( g[0][0] == a1+b1 &&
				g[0][1] == a1+b2 &&
				g[0][2] == a1+b3 &&
				g[1][0] == a2+b1 &&
				g[1][1] == a2+b2 &&
				g[1][2] == a2+b3 &&
				g[2][0] == a3+b1 &&
				g[2][1] == a3+b2 &&
				g[2][2] == a3+b3) {
				ok=true;
				break;
			}
		} int a1=i; a1 i int b1=g[0][0]-a1; b1 g[0][0]-a1 g[0][0] g[0] g 0 0 a1 int b2=g[0][1]-a1; b2 g[0][1]-a1 g[0][1] g[0] g 0 1 a1 int b3=g[0][2]-a1; b3 g[0][2]-a1 g[0][2] g[0] g 0 2 a1 int a2=g[1][0]-b1; a2 g[1][0]-b1 g[1][0] g[1] g 1 0 b1 int a3=g[2][0]-b1; a3 g[2][0]-b1 g[2][0] g[2] g 2 0 b1 if( g[0][0] == a1+b1 &&
				g[0][1] == a1+b2 &&
				g[0][2] == a1+b3 &&
				g[1][0] == a2+b1 &&
				g[1][1] == a2+b2 &&
				g[1][2] == a2+b3 &&
				g[2][0] == a3+b1 &&
				g[2][1] == a3+b2 &&
				g[2][2] == a3+b3) {
				ok=true;
				break;
			} g[0][0] == a1+b1 &&
				g[0][1] == a1+b2 &&
				g[0][2] == a1+b3 &&
				g[1][0] == a2+b1 &&
				g[1][1] == a2+b2 &&
				g[1][2] == a2+b3 &&
				g[2][0] == a3+b1 &&
				g[2][1] == a3+b2 &&
				g[2][2] == a3+b3 g[2][1] == a3+b2 g[2][0] == a3+b1 g[1][2] == a2+b3 g[1][1] == a2+b2 g[1][0] == a2+b1 g[0][2] == a1+b3 g[0][0] == a1+b1 &&
				g[0][1] == a1+b2 &&
				g[0][2] == a1+b3 &&
				g[1][0] == a2+b1 &&
				g[1][1] == a2+b2 &&
				g[1][2] == a2+b3 &&
				g[2][0] == a3+b1 &&
				g[2][1] == a3+b2 &&
				g[2][2] == a3+b3 g[0][0] == a1+b1 g[0][0] g[0] g 0 0 a1+b1 a1 b1 g[0][1] == a1+b2 g[0][1] g[0] g 0 1 a1+b2 a1 b2 g[0][2] == a1+b3 g[0][2] g[0] g 0 2 a1+b3 a1 b3 g[1][0] == a2+b1 g[1][0] g[1] g 1 0 a2+b1 a2 b1 g[1][1] == a2+b2 g[1][1] g[1] g 1 1 a2+b2 a2 b2 g[1][2] == a2+b3 g[1][2] g[1] g 1 2 a2+b3 a2 b3 g[2][0] == a3+b1 g[2][0] g[2] g 2 0 a3+b1 a3 b1 g[2][1] == a3+b2 g[2][1] g[2] g 2 1 a3+b2 a3 b2 g[2][2] == a3+b3 g[2][2] g[2] g 2 2 a3+b3 a3 b3 {
				ok=true;
				break;
			} ok=true ok true break; if(ok)System.out.println("Yes");
		else System.out.println("No"); ok 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" sc.close() sc.close sc public class Main {
	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}

	public void run() {
		Scanner sc = new Scanner(System.in);
		int g[][] = new int[3][3];
		for(int i=0; i<3; i++) {
			for(int j=0; j<3; j++) {
				g[i][j]=sc.nextInt();
			}
		}
		boolean ok = false;
		for(int i=0; i<=100; i++) {

			int a1=i;
			int b1=g[0][0]-a1;

			int b2=g[0][1]-a1;
			int b3=g[0][2]-a1;
			int a2=g[1][0]-b1;
			int a3=g[2][0]-b1;

			if( g[0][0] == a1+b1 &&
				g[0][1] == a1+b2 &&
				g[0][2] == a1+b3 &&
				g[1][0] == a2+b1 &&
				g[1][1] == a2+b2 &&
				g[1][2] == a2+b3 &&
				g[2][0] == a3+b1 &&
				g[2][1] == a3+b2 &&
				g[2][2] == a3+b3) {
				ok=true;
				break;
			}
		}
		if(ok)System.out.println("Yes");
		else System.out.println("No");
		sc.close();
	}
} public class Main {
	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}

	public void run() {
		Scanner sc = new Scanner(System.in);
		int g[][] = new int[3][3];
		for(int i=0; i<3; i++) {
			for(int j=0; j<3; j++) {
				g[i][j]=sc.nextInt();
			}
		}
		boolean ok = false;
		for(int i=0; i<=100; i++) {

			int a1=i;
			int b1=g[0][0]-a1;

			int b2=g[0][1]-a1;
			int b3=g[0][2]-a1;
			int a2=g[1][0]-b1;
			int a3=g[2][0]-b1;

			if( g[0][0] == a1+b1 &&
				g[0][1] == a1+b2 &&
				g[0][2] == a1+b3 &&
				g[1][0] == a2+b1 &&
				g[1][1] == a2+b2 &&
				g[1][2] == a2+b3 &&
				g[2][0] == a3+b1 &&
				g[2][1] == a3+b2 &&
				g[2][2] == a3+b3) {
				ok=true;
				break;
			}
		}
		if(ok)System.out.println("Yes");
		else System.out.println("No");
		sc.close();
	}
} Main

import java.util.Scanner;

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

	public void run() {
		Scanner sc = new Scanner(System.in);
		int g[][] = new int[3][3];
		for(int i=0; i<3; i++) {
			for(int j=0; j<3; j++) {
				g[i][j]=sc.nextInt();
			}
		}
		boolean ok = false;
		for(int i=0; i<=100; i++) {

			int a1=i;
			int b1=g[0][0]-a1;

			int b2=g[0][1]-a1;
			int b3=g[0][2]-a1;
			int a2=g[1][0]-b1;
			int a3=g[2][0]-b1;

			if( g[0][0] == a1+b1 &&
				g[0][1] == a1+b2 &&
				g[0][2] == a1+b3 &&
				g[1][0] == a2+b1 &&
				g[1][1] == a2+b2 &&
				g[1][2] == a2+b3 &&
				g[2][0] == a3+b1 &&
				g[2][1] == a3+b2 &&
				g[2][2] == a3+b3) {
				ok=true;
				break;
			}
		}
		if(ok)System.out.println("Yes");
		else System.out.println("No");
		sc.close();
	}
}
