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;
	}
}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz