import java.util.*;

public class Main{ 
  
  public static void main(String[] args) throws Exception{
    
    Scanner sc = new Scanner(System.in);
    
    int[] math = new int[9];
    for(int i = 0; i < 9; ++i){
      math[i] = sc.nextInt();
    }
    
    int a = math[1]-math[0];
    int b = math[4]-math[3];
    int c = math[7]-math[6];
    
    int d = math[2]-math[0];
    int e = math[5]-math[3];
    int f = math[8]-math[6];
    
    int g = math[3]-math[0];
    int h = math[4]-math[1];
    int i = math[5]-math[2];
      
    int j = math[6]-math[0];
    int k = math[7]-math[1];
    int l = math[8]-math[2];
      
    
    if((a == b && b == c && c ==a)
        && (d == e && e == f && f ==d)
        && (g == h && h == i && i ==g)
        && (j == k && k == l && l ==j)){
      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 sc = new Scanner(System.in);
    
    int[] math = new int[9];
    for(int i = 0; i < 9; ++i){
      math[i] = sc.nextInt();
    }
    
    int a = math[1]-math[0];
    int b = math[4]-math[3];
    int c = math[7]-math[6];
    
    int d = math[2]-math[0];
    int e = math[5]-math[3];
    int f = math[8]-math[6];
    
    int g = math[3]-math[0];
    int h = math[4]-math[1];
    int i = math[5]-math[2];
      
    int j = math[6]-math[0];
    int k = math[7]-math[1];
    int l = math[8]-math[2];
      
    
    if((a == b && b == c && c ==a)
        && (d == e && e == f && f ==d)
        && (g == h && h == i && i ==g)
        && (j == k && k == l && l ==j)){
      System.out.println("Yes");
    }else{
       System.out.println("No");
    } 
  }
} Main public static void main(String[] args) throws Exception{
    
    Scanner sc = new Scanner(System.in);
    
    int[] math = new int[9];
    for(int i = 0; i < 9; ++i){
      math[i] = sc.nextInt();
    }
    
    int a = math[1]-math[0];
    int b = math[4]-math[3];
    int c = math[7]-math[6];
    
    int d = math[2]-math[0];
    int e = math[5]-math[3];
    int f = math[8]-math[6];
    
    int g = math[3]-math[0];
    int h = math[4]-math[1];
    int i = math[5]-math[2];
      
    int j = math[6]-math[0];
    int k = math[7]-math[1];
    int l = math[8]-math[2];
      
    
    if((a == b && b == c && c ==a)
        && (d == e && e == f && f ==d)
        && (g == h && h == i && i ==g)
        && (j == k && k == l && l ==j)){
      System.out.println("Yes");
    }else{
       System.out.println("No");
    } 
  } main {
    
    Scanner sc = new Scanner(System.in);
    
    int[] math = new int[9];
    for(int i = 0; i < 9; ++i){
      math[i] = sc.nextInt();
    }
    
    int a = math[1]-math[0];
    int b = math[4]-math[3];
    int c = math[7]-math[6];
    
    int d = math[2]-math[0];
    int e = math[5]-math[3];
    int f = math[8]-math[6];
    
    int g = math[3]-math[0];
    int h = math[4]-math[1];
    int i = math[5]-math[2];
      
    int j = math[6]-math[0];
    int k = math[7]-math[1];
    int l = math[8]-math[2];
      
    
    if((a == b && b == c && c ==a)
        && (d == e && e == f && f ==d)
        && (g == h && h == i && i ==g)
        && (j == k && k == l && l ==j)){
      System.out.println("Yes");
    }else{
       System.out.println("No");
    } 
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] math = new int[9]; math new int[9] 9 for(int i = 0; i < 9; ++i){
      math[i] = sc.nextInt();
    } int i = 0; int i = 0; i 0 i < 9 i 9 ++i ++i i {
      math[i] = sc.nextInt();
    } {
      math[i] = sc.nextInt();
    } math[i] = sc.nextInt() math[i] math i sc.nextInt() sc.nextInt sc int a = math[1]-math[0]; a math[1]-math[0] math[1] math 1 math[0] math 0 int b = math[4]-math[3]; b math[4]-math[3] math[4] math 4 math[3] math 3 int c = math[7]-math[6]; c math[7]-math[6] math[7] math 7 math[6] math 6 int d = math[2]-math[0]; d math[2]-math[0] math[2] math 2 math[0] math 0 int e = math[5]-math[3]; e math[5]-math[3] math[5] math 5 math[3] math 3 int f = math[8]-math[6]; f math[8]-math[6] math[8] math 8 math[6] math 6 int g = math[3]-math[0]; g math[3]-math[0] math[3] math 3 math[0] math 0 int h = math[4]-math[1]; h math[4]-math[1] math[4] math 4 math[1] math 1 int i = math[5]-math[2]; i math[5]-math[2] math[5] math 5 math[2] math 2 int j = math[6]-math[0]; j math[6]-math[0] math[6] math 6 math[0] math 0 int k = math[7]-math[1]; k math[7]-math[1] math[7] math 7 math[1] math 1 int l = math[8]-math[2]; l math[8]-math[2] math[8] math 8 math[2] math 2 if((a == b && b == c && c ==a)
        && (d == e && e == f && f ==d)
        && (g == h && h == i && i ==g)
        && (j == k && k == l && l ==j)){
      System.out.println("Yes");
    }else{
       System.out.println("No");
    } (a == b && b == c && c ==a)
        && (d == e && e == f && f ==d)
        && (g == h && h == i && i ==g)
        && (j == k && k == l && l ==j) (g == h && h == i && i ==g) (a == b && b == c && c ==a)
        && (d == e && e == f && f ==d)
        && (g == h && h == i && i ==g)
        && (j == k && k == l && l ==j) (a == b && b == c && c ==a) a == b && b == c && c ==a a == b a b b == c b c c ==a c a (d == e && e == f && f ==d) d == e && e == f && f ==d d == e d e e == f e f f ==d f d (g == h && h == i && i ==g) g == h && h == i && i ==g g == h g h h == i h i i ==g i g (j == k && k == l && l ==j) j == k && k == l && l ==j j == k j k k == l k l l ==j l j {
      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 sc = new Scanner(System.in);
    
    int[] math = new int[9];
    for(int i = 0; i < 9; ++i){
      math[i] = sc.nextInt();
    }
    
    int a = math[1]-math[0];
    int b = math[4]-math[3];
    int c = math[7]-math[6];
    
    int d = math[2]-math[0];
    int e = math[5]-math[3];
    int f = math[8]-math[6];
    
    int g = math[3]-math[0];
    int h = math[4]-math[1];
    int i = math[5]-math[2];
      
    int j = math[6]-math[0];
    int k = math[7]-math[1];
    int l = math[8]-math[2];
      
    
    if((a == b && b == c && c ==a)
        && (d == e && e == f && f ==d)
        && (g == h && h == i && i ==g)
        && (j == k && k == l && l ==j)){
      System.out.println("Yes");
    }else{
       System.out.println("No");
    } 
  }
} public class Main{ 
  
  public static void main(String[] args) throws Exception{
    
    Scanner sc = new Scanner(System.in);
    
    int[] math = new int[9];
    for(int i = 0; i < 9; ++i){
      math[i] = sc.nextInt();
    }
    
    int a = math[1]-math[0];
    int b = math[4]-math[3];
    int c = math[7]-math[6];
    
    int d = math[2]-math[0];
    int e = math[5]-math[3];
    int f = math[8]-math[6];
    
    int g = math[3]-math[0];
    int h = math[4]-math[1];
    int i = math[5]-math[2];
      
    int j = math[6]-math[0];
    int k = math[7]-math[1];
    int l = math[8]-math[2];
      
    
    if((a == b && b == c && c ==a)
        && (d == e && e == f && f ==d)
        && (g == h && h == i && i ==g)
        && (j == k && k == l && l ==j)){
      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 sc = new Scanner(System.in);
    
    int[] math = new int[9];
    for(int i = 0; i < 9; ++i){
      math[i] = sc.nextInt();
    }
    
    int a = math[1]-math[0];
    int b = math[4]-math[3];
    int c = math[7]-math[6];
    
    int d = math[2]-math[0];
    int e = math[5]-math[3];
    int f = math[8]-math[6];
    
    int g = math[3]-math[0];
    int h = math[4]-math[1];
    int i = math[5]-math[2];
      
    int j = math[6]-math[0];
    int k = math[7]-math[1];
    int l = math[8]-math[2];
      
    
    if((a == b && b == c && c ==a)
        && (d == e && e == f && f ==d)
        && (g == h && h == i && i ==g)
        && (j == k && k == l && l ==j)){
      System.out.println("Yes");
    }else{
       System.out.println("No");
    } 
  }
} 
