//ABC81_B

import java.util.Scanner;

public class Main{

	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);

		int C11 = scan.nextInt();
		int C12 = scan.nextInt();
		int C13 = scan.nextInt();
		scan.nextLine();

		int C21 = scan.nextInt();
		int C22 = scan.nextInt();
		int C23 = scan.nextInt();
		scan.nextLine();

		int C31 = scan.nextInt();
		int C32 = scan.nextInt();
		int C33 = scan.nextInt();
		scan.nextLine();


		if(((C12-C11)==(C22-C21)&&(C22-C21)==(C32-C31))
			&& ((C13-C12)==(C23-C22)&&(C23-C22)==(C33-C32))
			&& ((C31-C21)==(C32-C22)&&(C32-C22)==(C33-C23))
			&& ((C21-C11)==(C22-C12)&&(C22-C12)==(C23-C13)))
			{System.out.println("Yes");	}
		else
			{System.out.println("No"); }

	}
} import java.util.Scanner; Scanner java.util public class Main{

	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);

		int C11 = scan.nextInt();
		int C12 = scan.nextInt();
		int C13 = scan.nextInt();
		scan.nextLine();

		int C21 = scan.nextInt();
		int C22 = scan.nextInt();
		int C23 = scan.nextInt();
		scan.nextLine();

		int C31 = scan.nextInt();
		int C32 = scan.nextInt();
		int C33 = scan.nextInt();
		scan.nextLine();


		if(((C12-C11)==(C22-C21)&&(C22-C21)==(C32-C31))
			&& ((C13-C12)==(C23-C22)&&(C23-C22)==(C33-C32))
			&& ((C31-C21)==(C32-C22)&&(C32-C22)==(C33-C23))
			&& ((C21-C11)==(C22-C12)&&(C22-C12)==(C23-C13)))
			{System.out.println("Yes");	}
		else
			{System.out.println("No"); }

	}
} Main public static void main(String[] args){

		Scanner scan = new Scanner(System.in);

		int C11 = scan.nextInt();
		int C12 = scan.nextInt();
		int C13 = scan.nextInt();
		scan.nextLine();

		int C21 = scan.nextInt();
		int C22 = scan.nextInt();
		int C23 = scan.nextInt();
		scan.nextLine();

		int C31 = scan.nextInt();
		int C32 = scan.nextInt();
		int C33 = scan.nextInt();
		scan.nextLine();


		if(((C12-C11)==(C22-C21)&&(C22-C21)==(C32-C31))
			&& ((C13-C12)==(C23-C22)&&(C23-C22)==(C33-C32))
			&& ((C31-C21)==(C32-C22)&&(C32-C22)==(C33-C23))
			&& ((C21-C11)==(C22-C12)&&(C22-C12)==(C23-C13)))
			{System.out.println("Yes");	}
		else
			{System.out.println("No"); }

	} main {

		Scanner scan = new Scanner(System.in);

		int C11 = scan.nextInt();
		int C12 = scan.nextInt();
		int C13 = scan.nextInt();
		scan.nextLine();

		int C21 = scan.nextInt();
		int C22 = scan.nextInt();
		int C23 = scan.nextInt();
		scan.nextLine();

		int C31 = scan.nextInt();
		int C32 = scan.nextInt();
		int C33 = scan.nextInt();
		scan.nextLine();


		if(((C12-C11)==(C22-C21)&&(C22-C21)==(C32-C31))
			&& ((C13-C12)==(C23-C22)&&(C23-C22)==(C33-C32))
			&& ((C31-C21)==(C32-C22)&&(C32-C22)==(C33-C23))
			&& ((C21-C11)==(C22-C12)&&(C22-C12)==(C23-C13)))
			{System.out.println("Yes");	}
		else
			{System.out.println("No"); }

	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int C11 = scan.nextInt(); C11 scan.nextInt() scan.nextInt scan int C12 = scan.nextInt(); C12 scan.nextInt() scan.nextInt scan int C13 = scan.nextInt(); C13 scan.nextInt() scan.nextInt scan scan.nextLine() scan.nextLine scan int C21 = scan.nextInt(); C21 scan.nextInt() scan.nextInt scan int C22 = scan.nextInt(); C22 scan.nextInt() scan.nextInt scan int C23 = scan.nextInt(); C23 scan.nextInt() scan.nextInt scan scan.nextLine() scan.nextLine scan int C31 = scan.nextInt(); C31 scan.nextInt() scan.nextInt scan int C32 = scan.nextInt(); C32 scan.nextInt() scan.nextInt scan int C33 = scan.nextInt(); C33 scan.nextInt() scan.nextInt scan scan.nextLine() scan.nextLine scan if(((C12-C11)==(C22-C21)&&(C22-C21)==(C32-C31))
			&& ((C13-C12)==(C23-C22)&&(C23-C22)==(C33-C32))
			&& ((C31-C21)==(C32-C22)&&(C32-C22)==(C33-C23))
			&& ((C21-C11)==(C22-C12)&&(C22-C12)==(C23-C13)))
			{System.out.println("Yes");	}
		else
			{System.out.println("No"); } ((C12-C11)==(C22-C21)&&(C22-C21)==(C32-C31))
			&& ((C13-C12)==(C23-C22)&&(C23-C22)==(C33-C32))
			&& ((C31-C21)==(C32-C22)&&(C32-C22)==(C33-C23))
			&& ((C21-C11)==(C22-C12)&&(C22-C12)==(C23-C13)) ((C31-C21)==(C32-C22)&&(C32-C22)==(C33-C23)) ((C12-C11)==(C22-C21)&&(C22-C21)==(C32-C31))
			&& ((C13-C12)==(C23-C22)&&(C23-C22)==(C33-C32))
			&& ((C31-C21)==(C32-C22)&&(C32-C22)==(C33-C23))
			&& ((C21-C11)==(C22-C12)&&(C22-C12)==(C23-C13)) ((C12-C11)==(C22-C21)&&(C22-C21)==(C32-C31)) (C12-C11)==(C22-C21) (C12-C11) C12 C11 (C22-C21) C22 C21 (C22-C21)==(C32-C31) (C22-C21) C22 C21 (C32-C31) C32 C31 ((C13-C12)==(C23-C22)&&(C23-C22)==(C33-C32)) (C13-C12)==(C23-C22) (C13-C12) C13 C12 (C23-C22) C23 C22 (C23-C22)==(C33-C32) (C23-C22) C23 C22 (C33-C32) C33 C32 ((C31-C21)==(C32-C22)&&(C32-C22)==(C33-C23)) (C31-C21)==(C32-C22) (C31-C21) C31 C21 (C32-C22) C32 C22 (C32-C22)==(C33-C23) (C32-C22) C32 C22 (C33-C23) C33 C23 ((C21-C11)==(C22-C12)&&(C22-C12)==(C23-C13)) (C21-C11)==(C22-C12) (C21-C11) C21 C11 (C22-C12) C22 C12 (C22-C12)==(C23-C13) (C22-C12) C22 C12 (C23-C13) C23 C13 {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 scan = new Scanner(System.in);

		int C11 = scan.nextInt();
		int C12 = scan.nextInt();
		int C13 = scan.nextInt();
		scan.nextLine();

		int C21 = scan.nextInt();
		int C22 = scan.nextInt();
		int C23 = scan.nextInt();
		scan.nextLine();

		int C31 = scan.nextInt();
		int C32 = scan.nextInt();
		int C33 = scan.nextInt();
		scan.nextLine();


		if(((C12-C11)==(C22-C21)&&(C22-C21)==(C32-C31))
			&& ((C13-C12)==(C23-C22)&&(C23-C22)==(C33-C32))
			&& ((C31-C21)==(C32-C22)&&(C32-C22)==(C33-C23))
			&& ((C21-C11)==(C22-C12)&&(C22-C12)==(C23-C13)))
			{System.out.println("Yes");	}
		else
			{System.out.println("No"); }

	}
} public class Main{

	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);

		int C11 = scan.nextInt();
		int C12 = scan.nextInt();
		int C13 = scan.nextInt();
		scan.nextLine();

		int C21 = scan.nextInt();
		int C22 = scan.nextInt();
		int C23 = scan.nextInt();
		scan.nextLine();

		int C31 = scan.nextInt();
		int C32 = scan.nextInt();
		int C33 = scan.nextInt();
		scan.nextLine();


		if(((C12-C11)==(C22-C21)&&(C22-C21)==(C32-C31))
			&& ((C13-C12)==(C23-C22)&&(C23-C22)==(C33-C32))
			&& ((C31-C21)==(C32-C22)&&(C32-C22)==(C33-C23))
			&& ((C21-C11)==(C22-C12)&&(C22-C12)==(C23-C13)))
			{System.out.println("Yes");	}
		else
			{System.out.println("No"); }

	}
} Main
//ABC81_B

import java.util.Scanner;

public class Main{

	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);

		int C11 = scan.nextInt();
		int C12 = scan.nextInt();
		int C13 = scan.nextInt();
		scan.nextLine();

		int C21 = scan.nextInt();
		int C22 = scan.nextInt();
		int C23 = scan.nextInt();
		scan.nextLine();

		int C31 = scan.nextInt();
		int C32 = scan.nextInt();
		int C33 = scan.nextInt();
		scan.nextLine();


		if(((C12-C11)==(C22-C21)&&(C22-C21)==(C32-C31))
			&& ((C13-C12)==(C23-C22)&&(C23-C22)==(C33-C32))
			&& ((C31-C21)==(C32-C22)&&(C32-C22)==(C33-C23))
			&& ((C21-C11)==(C22-C12)&&(C22-C12)==(C23-C13)))
			{System.out.println("Yes");	}
		else
			{System.out.println("No"); }

	}
}