import java.util.Scanner;
import java.util.Random;
import java.util.Arrays;
import java.util.Comparator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.HashMap;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		
		int[] s = new int[9];
		
		for (int i = 0; i < 9; i++) {
			s[i] = sc.nextInt();
			
		}
		
		if (s[0] + s[4] + s[8] == s[1] + s[5] + s[6] && s[1] + s[5] + s[6] == s[2] + s[3] + s[7]) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
		
}
	
	 import java.util.Scanner; Scanner java.util import java.util.Random; Random java.util import java.util.Arrays; Arrays java.util import java.util.Comparator; Comparator java.util import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.List; List java.util import java.util.HashMap; HashMap java.util import java.time.format.DateTimeFormatter; DateTimeFormatter java.time.format import java.time.temporal.ChronoUnit; ChronoUnit java.time.temporal public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		
		int[] s = new int[9];
		
		for (int i = 0; i < 9; i++) {
			s[i] = sc.nextInt();
			
		}
		
		if (s[0] + s[4] + s[8] == s[1] + s[5] + s[6] && s[1] + s[5] + s[6] == s[2] + s[3] + s[7]) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
		
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		
		int[] s = new int[9];
		
		for (int i = 0; i < 9; i++) {
			s[i] = sc.nextInt();
			
		}
		
		if (s[0] + s[4] + s[8] == s[1] + s[5] + s[6] && s[1] + s[5] + s[6] == s[2] + s[3] + s[7]) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	} main {
		Scanner sc = new Scanner(System.in);
		
		
		int[] s = new int[9];
		
		for (int i = 0; i < 9; i++) {
			s[i] = sc.nextInt();
			
		}
		
		if (s[0] + s[4] + s[8] == s[1] + s[5] + s[6] && s[1] + s[5] + s[6] == s[2] + s[3] + s[7]) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] s = new int[9]; s new int[9] 9 for (int i = 0; i < 9; i++) {
			s[i] = sc.nextInt();
			
		} int i = 0; int i = 0; i 0 i < 9 i 9 i++ i++ i {
			s[i] = sc.nextInt();
			
		} {
			s[i] = sc.nextInt();
			
		} s[i] = sc.nextInt() s[i] s i sc.nextInt() sc.nextInt sc if (s[0] + s[4] + s[8] == s[1] + s[5] + s[6] && s[1] + s[5] + s[6] == s[2] + s[3] + s[7]) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		} s[0] + s[4] + s[8] == s[1] + s[5] + s[6] && s[1] + s[5] + s[6] == s[2] + s[3] + s[7] s[0] + s[4] + s[8] == s[1] + s[5] + s[6] s[0] + s[4] + s[8] s[0] + s[4] + s[8] s[0] s 0 s[4] s 4 s[8] s 8 s[1] + s[5] + s[6] s[1] + s[5] + s[6] s[1] s 1 s[5] s 5 s[6] s 6 s[1] + s[5] + s[6] == s[2] + s[3] + s[7] s[1] + s[5] + s[6] s[1] + s[5] + s[6] s[1] s 1 s[5] s 5 s[6] s 6 s[2] + s[3] + s[7] s[2] + s[3] + s[7] s[2] s 2 s[3] s 3 s[7] s 7 {
			System.out.println("Yes");
		} System.out.println("Yes") System.out.println System.out System System.out "Yes" {
			System.out.println("No");
		} System.out.println("No") System.out.println System.out System System.out "No" String[] args args public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		
		int[] s = new int[9];
		
		for (int i = 0; i < 9; i++) {
			s[i] = sc.nextInt();
			
		}
		
		if (s[0] + s[4] + s[8] == s[1] + s[5] + s[6] && s[1] + s[5] + s[6] == s[2] + s[3] + s[7]) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
		
} public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		
		int[] s = new int[9];
		
		for (int i = 0; i < 9; i++) {
			s[i] = sc.nextInt();
			
		}
		
		if (s[0] + s[4] + s[8] == s[1] + s[5] + s[6] && s[1] + s[5] + s[6] == s[2] + s[3] + s[7]) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
		
} Main
import java.util.Scanner;
import java.util.Random;
import java.util.Arrays;
import java.util.Comparator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.HashMap;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		
		int[] s = new int[9];
		
		for (int i = 0; i < 9; i++) {
			s[i] = sc.nextInt();
			
		}
		
		if (s[0] + s[4] + s[8] == s[1] + s[5] + s[6] && s[1] + s[5] + s[6] == s[2] + s[3] + s[7]) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
		
}
	
	
