import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int D = sc.nextInt();
		int E = sc.nextInt();
		int F = sc.nextInt();
		int G = sc.nextInt();
		int H = sc.nextInt();
		int I = sc.nextInt();
		int sum = A+E+I;
		Main main = new Main();
		if (main.checkSum(sum,A,H,F)==false) {
			System.out.println("No");
			return ;
		}
		if (main.checkSum(sum,D,B,I)==false) {
			System.out.println("No");
			return ;
		}
		if (main.checkSum(sum,D,H,C)==false) {
			System.out.println("No");
			return ;
		}
		if (main.checkSum(sum,G,E,C)==false) {
			System.out.println("No");
			return ;
		}
		if (main.checkSum(sum,G,B,F)==false) {
			System.out.println("No");
			return ;
		}
			System.out.println("Yes");
	}

	public boolean checkSum(int sum ,int A,int B,int C) {
		if (A+B+C==sum)
			return true;
		return false;
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int D = sc.nextInt();
		int E = sc.nextInt();
		int F = sc.nextInt();
		int G = sc.nextInt();
		int H = sc.nextInt();
		int I = sc.nextInt();
		int sum = A+E+I;
		Main main = new Main();
		if (main.checkSum(sum,A,H,F)==false) {
			System.out.println("No");
			return ;
		}
		if (main.checkSum(sum,D,B,I)==false) {
			System.out.println("No");
			return ;
		}
		if (main.checkSum(sum,D,H,C)==false) {
			System.out.println("No");
			return ;
		}
		if (main.checkSum(sum,G,E,C)==false) {
			System.out.println("No");
			return ;
		}
		if (main.checkSum(sum,G,B,F)==false) {
			System.out.println("No");
			return ;
		}
			System.out.println("Yes");
	}

	public boolean checkSum(int sum ,int A,int B,int C) {
		if (A+B+C==sum)
			return true;
		return false;
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int D = sc.nextInt();
		int E = sc.nextInt();
		int F = sc.nextInt();
		int G = sc.nextInt();
		int H = sc.nextInt();
		int I = sc.nextInt();
		int sum = A+E+I;
		Main main = new Main();
		if (main.checkSum(sum,A,H,F)==false) {
			System.out.println("No");
			return ;
		}
		if (main.checkSum(sum,D,B,I)==false) {
			System.out.println("No");
			return ;
		}
		if (main.checkSum(sum,D,H,C)==false) {
			System.out.println("No");
			return ;
		}
		if (main.checkSum(sum,G,E,C)==false) {
			System.out.println("No");
			return ;
		}
		if (main.checkSum(sum,G,B,F)==false) {
			System.out.println("No");
			return ;
		}
			System.out.println("Yes");
	} main {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int D = sc.nextInt();
		int E = sc.nextInt();
		int F = sc.nextInt();
		int G = sc.nextInt();
		int H = sc.nextInt();
		int I = sc.nextInt();
		int sum = A+E+I;
		Main main = new Main();
		if (main.checkSum(sum,A,H,F)==false) {
			System.out.println("No");
			return ;
		}
		if (main.checkSum(sum,D,B,I)==false) {
			System.out.println("No");
			return ;
		}
		if (main.checkSum(sum,D,H,C)==false) {
			System.out.println("No");
			return ;
		}
		if (main.checkSum(sum,G,E,C)==false) {
			System.out.println("No");
			return ;
		}
		if (main.checkSum(sum,G,B,F)==false) {
			System.out.println("No");
			return ;
		}
			System.out.println("Yes");
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int A = sc.nextInt(); A sc.nextInt() sc.nextInt sc int B = sc.nextInt(); B sc.nextInt() sc.nextInt sc int C = sc.nextInt(); C sc.nextInt() sc.nextInt sc int D = sc.nextInt(); D sc.nextInt() sc.nextInt sc int E = sc.nextInt(); E sc.nextInt() sc.nextInt sc int F = sc.nextInt(); F sc.nextInt() sc.nextInt sc int G = sc.nextInt(); G sc.nextInt() sc.nextInt sc int H = sc.nextInt(); H sc.nextInt() sc.nextInt sc int I = sc.nextInt(); I sc.nextInt() sc.nextInt sc int sum = A+E+I; sum A+E+I A+E+I A E I Main main = new Main(); main new Main() if (main.checkSum(sum,A,H,F)==false) {
			System.out.println("No");
			return ;
		} main.checkSum(sum,A,H,F)==false main.checkSum(sum,A,H,F) main.checkSum main sum A H F false {
			System.out.println("No");
			return ;
		} System.out.println("No") System.out.println System.out System System.out "No" return ; if (main.checkSum(sum,D,B,I)==false) {
			System.out.println("No");
			return ;
		} main.checkSum(sum,D,B,I)==false main.checkSum(sum,D,B,I) main.checkSum main sum D B I false {
			System.out.println("No");
			return ;
		} System.out.println("No") System.out.println System.out System System.out "No" return ; if (main.checkSum(sum,D,H,C)==false) {
			System.out.println("No");
			return ;
		} main.checkSum(sum,D,H,C)==false main.checkSum(sum,D,H,C) main.checkSum main sum D H C false {
			System.out.println("No");
			return ;
		} System.out.println("No") System.out.println System.out System System.out "No" return ; if (main.checkSum(sum,G,E,C)==false) {
			System.out.println("No");
			return ;
		} main.checkSum(sum,G,E,C)==false main.checkSum(sum,G,E,C) main.checkSum main sum G E C false {
			System.out.println("No");
			return ;
		} System.out.println("No") System.out.println System.out System System.out "No" return ; if (main.checkSum(sum,G,B,F)==false) {
			System.out.println("No");
			return ;
		} main.checkSum(sum,G,B,F)==false main.checkSum(sum,G,B,F) main.checkSum main sum G B F false {
			System.out.println("No");
			return ;
		} System.out.println("No") System.out.println System.out System System.out "No" return ; System.out.println("Yes") System.out.println System.out System System.out "Yes" String[] args args public boolean checkSum(int sum ,int A,int B,int C) {
		if (A+B+C==sum)
			return true;
		return false;
	} checkSum {
		if (A+B+C==sum)
			return true;
		return false;
	} if (A+B+C==sum)
			return true; A+B+C==sum A+B+C A+B+C A B C sum return true; true return false; false int sum sum int A A int B B int C C public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int D = sc.nextInt();
		int E = sc.nextInt();
		int F = sc.nextInt();
		int G = sc.nextInt();
		int H = sc.nextInt();
		int I = sc.nextInt();
		int sum = A+E+I;
		Main main = new Main();
		if (main.checkSum(sum,A,H,F)==false) {
			System.out.println("No");
			return ;
		}
		if (main.checkSum(sum,D,B,I)==false) {
			System.out.println("No");
			return ;
		}
		if (main.checkSum(sum,D,H,C)==false) {
			System.out.println("No");
			return ;
		}
		if (main.checkSum(sum,G,E,C)==false) {
			System.out.println("No");
			return ;
		}
		if (main.checkSum(sum,G,B,F)==false) {
			System.out.println("No");
			return ;
		}
			System.out.println("Yes");
	}

	public boolean checkSum(int sum ,int A,int B,int C) {
		if (A+B+C==sum)
			return true;
		return false;
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int D = sc.nextInt();
		int E = sc.nextInt();
		int F = sc.nextInt();
		int G = sc.nextInt();
		int H = sc.nextInt();
		int I = sc.nextInt();
		int sum = A+E+I;
		Main main = new Main();
		if (main.checkSum(sum,A,H,F)==false) {
			System.out.println("No");
			return ;
		}
		if (main.checkSum(sum,D,B,I)==false) {
			System.out.println("No");
			return ;
		}
		if (main.checkSum(sum,D,H,C)==false) {
			System.out.println("No");
			return ;
		}
		if (main.checkSum(sum,G,E,C)==false) {
			System.out.println("No");
			return ;
		}
		if (main.checkSum(sum,G,B,F)==false) {
			System.out.println("No");
			return ;
		}
			System.out.println("Yes");
	}

	public boolean checkSum(int sum ,int A,int B,int C) {
		if (A+B+C==sum)
			return true;
		return false;
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int D = sc.nextInt();
		int E = sc.nextInt();
		int F = sc.nextInt();
		int G = sc.nextInt();
		int H = sc.nextInt();
		int I = sc.nextInt();
		int sum = A+E+I;
		Main main = new Main();
		if (main.checkSum(sum,A,H,F)==false) {
			System.out.println("No");
			return ;
		}
		if (main.checkSum(sum,D,B,I)==false) {
			System.out.println("No");
			return ;
		}
		if (main.checkSum(sum,D,H,C)==false) {
			System.out.println("No");
			return ;
		}
		if (main.checkSum(sum,G,E,C)==false) {
			System.out.println("No");
			return ;
		}
		if (main.checkSum(sum,G,B,F)==false) {
			System.out.println("No");
			return ;
		}
			System.out.println("Yes");
	}

	public boolean checkSum(int sum ,int A,int B,int C) {
		if (A+B+C==sum)
			return true;
		return false;
	}
}