
import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		int n[][] = new int[3][3];
		int total = 0;
		for(int i = 0;i<3;i++){
			for(int j = 0;j<3;j++){
				int a = sc.nextInt();
				total+=a;
				n[i][j] = a;
			}
		}String ans = "Yes";
		for(int i = 0;i<1;i++){
			if(total%3!=0){
				ans = "No";break;
			}total/=3;
			if((n[0][0]+n[1][1]+n[2][2])!=total||(n[0][2]+n[1][1]+n[2][0])!=total){
				ans = "No";break;
			}
		}System.out.println(ans);
	}
} import java.util.*; util.* java import java.lang.*; lang.* java import java.io.*; io.* java class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		int n[][] = new int[3][3];
		int total = 0;
		for(int i = 0;i<3;i++){
			for(int j = 0;j<3;j++){
				int a = sc.nextInt();
				total+=a;
				n[i][j] = a;
			}
		}String ans = "Yes";
		for(int i = 0;i<1;i++){
			if(total%3!=0){
				ans = "No";break;
			}total/=3;
			if((n[0][0]+n[1][1]+n[2][2])!=total||(n[0][2]+n[1][1]+n[2][0])!=total){
				ans = "No";break;
			}
		}System.out.println(ans);
	}
} Main public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		int n[][] = new int[3][3];
		int total = 0;
		for(int i = 0;i<3;i++){
			for(int j = 0;j<3;j++){
				int a = sc.nextInt();
				total+=a;
				n[i][j] = a;
			}
		}String ans = "Yes";
		for(int i = 0;i<1;i++){
			if(total%3!=0){
				ans = "No";break;
			}total/=3;
			if((n[0][0]+n[1][1]+n[2][2])!=total||(n[0][2]+n[1][1]+n[2][0])!=total){
				ans = "No";break;
			}
		}System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int n[][] = new int[3][3];
		int total = 0;
		for(int i = 0;i<3;i++){
			for(int j = 0;j<3;j++){
				int a = sc.nextInt();
				total+=a;
				n[i][j] = a;
			}
		}String ans = "Yes";
		for(int i = 0;i<1;i++){
			if(total%3!=0){
				ans = "No";break;
			}total/=3;
			if((n[0][0]+n[1][1]+n[2][2])!=total||(n[0][2]+n[1][1]+n[2][0])!=total){
				ans = "No";break;
			}
		}System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n[][] = new int[3][3]; n new int[3][3] 3 3 int total = 0; total 0 for(int i = 0;i<3;i++){
			for(int j = 0;j<3;j++){
				int a = sc.nextInt();
				total+=a;
				n[i][j] = a;
			}
		} int i = 0; int i = 0; i 0 i<3 i 3 i++ i++ i {
			for(int j = 0;j<3;j++){
				int a = sc.nextInt();
				total+=a;
				n[i][j] = a;
			}
		} {
			for(int j = 0;j<3;j++){
				int a = sc.nextInt();
				total+=a;
				n[i][j] = a;
			}
		} for(int j = 0;j<3;j++){
				int a = sc.nextInt();
				total+=a;
				n[i][j] = a;
			} int j = 0; int j = 0; j 0 j<3 j 3 j++ j++ j {
				int a = sc.nextInt();
				total+=a;
				n[i][j] = a;
			} {
				int a = sc.nextInt();
				total+=a;
				n[i][j] = a;
			} int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc total+=a total a n[i][j] = a n[i][j] n[i] n i j a String ans = "Yes"; ans "Yes" for(int i = 0;i<1;i++){
			if(total%3!=0){
				ans = "No";break;
			}total/=3;
			if((n[0][0]+n[1][1]+n[2][2])!=total||(n[0][2]+n[1][1]+n[2][0])!=total){
				ans = "No";break;
			}
		} int i = 0; int i = 0; i 0 i<1 i 1 i++ i++ i {
			if(total%3!=0){
				ans = "No";break;
			}total/=3;
			if((n[0][0]+n[1][1]+n[2][2])!=total||(n[0][2]+n[1][1]+n[2][0])!=total){
				ans = "No";break;
			}
		} {
			if(total%3!=0){
				ans = "No";break;
			}total/=3;
			if((n[0][0]+n[1][1]+n[2][2])!=total||(n[0][2]+n[1][1]+n[2][0])!=total){
				ans = "No";break;
			}
		} if(total%3!=0){
				ans = "No";break;
			} total%3!=0 total%3 total 3 0 {
				ans = "No";break;
			} ans = "No" ans "No" break; total/=3 total 3 if((n[0][0]+n[1][1]+n[2][2])!=total||(n[0][2]+n[1][1]+n[2][0])!=total){
				ans = "No";break;
			} (n[0][0]+n[1][1]+n[2][2])!=total||(n[0][2]+n[1][1]+n[2][0])!=total (n[0][0]+n[1][1]+n[2][2])!=total (n[0][0]+n[1][1]+n[2][2]) n[0][0]+n[1][1]+n[2][2] n[0][0] n[0] n 0 0 n[1][1] n[1] n 1 1 n[2][2] n[2] n 2 2 total (n[0][2]+n[1][1]+n[2][0])!=total (n[0][2]+n[1][1]+n[2][0]) n[0][2]+n[1][1]+n[2][0] n[0][2] n[0] n 0 2 n[1][1] n[1] n 1 1 n[2][0] n[2] n 2 0 total {
				ans = "No";break;
			} ans = "No" ans "No" break; System.out.println(ans) System.out.println System.out System System.out ans String[] args args

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		int n[][] = new int[3][3];
		int total = 0;
		for(int i = 0;i<3;i++){
			for(int j = 0;j<3;j++){
				int a = sc.nextInt();
				total+=a;
				n[i][j] = a;
			}
		}String ans = "Yes";
		for(int i = 0;i<1;i++){
			if(total%3!=0){
				ans = "No";break;
			}total/=3;
			if((n[0][0]+n[1][1]+n[2][2])!=total||(n[0][2]+n[1][1]+n[2][0])!=total){
				ans = "No";break;
			}
		}System.out.println(ans);
	}
}