import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception{
	Scanner scn = new Scanner(System.in);
      int check = 0;
      int[] a = new int[9];
      for(int i=0; i<a.length; ++i){
        a[i] = scn.nextInt();
      }
      int x1 = a[3] - a[0];
      int x2 = a[6] - a[3];
      
      if(a[4] != a[1]+x1){
        check=1;
      } if(a[5] != a[2]+x1){
        check=1;
      } if(a[7] != a[4]+x2){
        check=1;
      } if(a[8] != a[5]+x2){
        check=1;
      }
      
      if(check==0){
        System.out.println("Yes");
      }else{
        System.out.println("No");
      }
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) throws Exception{
	Scanner scn = new Scanner(System.in);
      int check = 0;
      int[] a = new int[9];
      for(int i=0; i<a.length; ++i){
        a[i] = scn.nextInt();
      }
      int x1 = a[3] - a[0];
      int x2 = a[6] - a[3];
      
      if(a[4] != a[1]+x1){
        check=1;
      } if(a[5] != a[2]+x1){
        check=1;
      } if(a[7] != a[4]+x2){
        check=1;
      } if(a[8] != a[5]+x2){
        check=1;
      }
      
      if(check==0){
        System.out.println("Yes");
      }else{
        System.out.println("No");
      }
	}
} Main public static void main(String[] args) throws Exception{
	Scanner scn = new Scanner(System.in);
      int check = 0;
      int[] a = new int[9];
      for(int i=0; i<a.length; ++i){
        a[i] = scn.nextInt();
      }
      int x1 = a[3] - a[0];
      int x2 = a[6] - a[3];
      
      if(a[4] != a[1]+x1){
        check=1;
      } if(a[5] != a[2]+x1){
        check=1;
      } if(a[7] != a[4]+x2){
        check=1;
      } if(a[8] != a[5]+x2){
        check=1;
      }
      
      if(check==0){
        System.out.println("Yes");
      }else{
        System.out.println("No");
      }
	} main {
	Scanner scn = new Scanner(System.in);
      int check = 0;
      int[] a = new int[9];
      for(int i=0; i<a.length; ++i){
        a[i] = scn.nextInt();
      }
      int x1 = a[3] - a[0];
      int x2 = a[6] - a[3];
      
      if(a[4] != a[1]+x1){
        check=1;
      } if(a[5] != a[2]+x1){
        check=1;
      } if(a[7] != a[4]+x2){
        check=1;
      } if(a[8] != a[5]+x2){
        check=1;
      }
      
      if(check==0){
        System.out.println("Yes");
      }else{
        System.out.println("No");
      }
	} Scanner scn = new Scanner(System.in); scn new Scanner(System.in) int check = 0; check 0 int[] a = new int[9]; a new int[9] 9 for(int i=0; i<a.length; ++i){
        a[i] = scn.nextInt();
      } int i=0; int i=0; i 0 i<a.length i a.length a a.length ++i ++i i {
        a[i] = scn.nextInt();
      } {
        a[i] = scn.nextInt();
      } a[i] = scn.nextInt() a[i] a i scn.nextInt() scn.nextInt scn int x1 = a[3] - a[0]; x1 a[3] - a[0] a[3] a 3 a[0] a 0 int x2 = a[6] - a[3]; x2 a[6] - a[3] a[6] a 6 a[3] a 3 if(a[4] != a[1]+x1){
        check=1;
      } a[4] != a[1]+x1 a[4] a 4 a[1]+x1 a[1] a 1 x1 {
        check=1;
      } check=1 check 1 if(a[5] != a[2]+x1){
        check=1;
      } a[5] != a[2]+x1 a[5] a 5 a[2]+x1 a[2] a 2 x1 {
        check=1;
      } check=1 check 1 if(a[7] != a[4]+x2){
        check=1;
      } a[7] != a[4]+x2 a[7] a 7 a[4]+x2 a[4] a 4 x2 {
        check=1;
      } check=1 check 1 if(a[8] != a[5]+x2){
        check=1;
      } a[8] != a[5]+x2 a[8] a 8 a[5]+x2 a[5] a 5 x2 {
        check=1;
      } check=1 check 1 if(check==0){
        System.out.println("Yes");
      }else{
        System.out.println("No");
      } check==0 check 0 {
        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) throws Exception{
	Scanner scn = new Scanner(System.in);
      int check = 0;
      int[] a = new int[9];
      for(int i=0; i<a.length; ++i){
        a[i] = scn.nextInt();
      }
      int x1 = a[3] - a[0];
      int x2 = a[6] - a[3];
      
      if(a[4] != a[1]+x1){
        check=1;
      } if(a[5] != a[2]+x1){
        check=1;
      } if(a[7] != a[4]+x2){
        check=1;
      } if(a[8] != a[5]+x2){
        check=1;
      }
      
      if(check==0){
        System.out.println("Yes");
      }else{
        System.out.println("No");
      }
	}
} public class Main {
	public static void main(String[] args) throws Exception{
	Scanner scn = new Scanner(System.in);
      int check = 0;
      int[] a = new int[9];
      for(int i=0; i<a.length; ++i){
        a[i] = scn.nextInt();
      }
      int x1 = a[3] - a[0];
      int x2 = a[6] - a[3];
      
      if(a[4] != a[1]+x1){
        check=1;
      } if(a[5] != a[2]+x1){
        check=1;
      } if(a[7] != a[4]+x2){
        check=1;
      } if(a[8] != a[5]+x2){
        check=1;
      }
      
      if(check==0){
        System.out.println("Yes");
      }else{
        System.out.println("No");
      }
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception{
	Scanner scn = new Scanner(System.in);
      int check = 0;
      int[] a = new int[9];
      for(int i=0; i<a.length; ++i){
        a[i] = scn.nextInt();
      }
      int x1 = a[3] - a[0];
      int x2 = a[6] - a[3];
      
      if(a[4] != a[1]+x1){
        check=1;
      } if(a[5] != a[2]+x1){
        check=1;
      } if(a[7] != a[4]+x2){
        check=1;
      } if(a[8] != a[5]+x2){
        check=1;
      }
      
      if(check==0){
        System.out.println("Yes");
      }else{
        System.out.println("No");
      }
	}
}
