import java.util.*;
 
class Main{
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    
    int[][] a = new int[3][3];
    int[] x = new int[3];
    int[] y = new int[3];
    int max = Integer.MIN_VALUE;
    for(int i=0; i<3; i++){
      for(int j=0; j<3; j++){
        a[i][j] = sc.nextInt();
        if(a[i][j] > max){
          max = a[i][j];
        }
      }
    }
    String f = "Yes";
    
    x[0] = 0;
    for(int j=0; j<3; j++){
      y[j] = a[0][j] - x[0];
    }
    for(int j=0; j<3; j++){
      x[j] = a[j][0] - y[0];
    }
    for(int i=0; i<3; i++){
      for(int j=0; j<3; j++){
        if(a[i][j] != x[i]+y[j]){
          f = "No";
        }
      }
    }
    System.out.println(f);

    sc.close();
  }
} import java.util.*; util.* java class Main{
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    
    int[][] a = new int[3][3];
    int[] x = new int[3];
    int[] y = new int[3];
    int max = Integer.MIN_VALUE;
    for(int i=0; i<3; i++){
      for(int j=0; j<3; j++){
        a[i][j] = sc.nextInt();
        if(a[i][j] > max){
          max = a[i][j];
        }
      }
    }
    String f = "Yes";
    
    x[0] = 0;
    for(int j=0; j<3; j++){
      y[j] = a[0][j] - x[0];
    }
    for(int j=0; j<3; j++){
      x[j] = a[j][0] - y[0];
    }
    for(int i=0; i<3; i++){
      for(int j=0; j<3; j++){
        if(a[i][j] != x[i]+y[j]){
          f = "No";
        }
      }
    }
    System.out.println(f);

    sc.close();
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    
    int[][] a = new int[3][3];
    int[] x = new int[3];
    int[] y = new int[3];
    int max = Integer.MIN_VALUE;
    for(int i=0; i<3; i++){
      for(int j=0; j<3; j++){
        a[i][j] = sc.nextInt();
        if(a[i][j] > max){
          max = a[i][j];
        }
      }
    }
    String f = "Yes";
    
    x[0] = 0;
    for(int j=0; j<3; j++){
      y[j] = a[0][j] - x[0];
    }
    for(int j=0; j<3; j++){
      x[j] = a[j][0] - y[0];
    }
    for(int i=0; i<3; i++){
      for(int j=0; j<3; j++){
        if(a[i][j] != x[i]+y[j]){
          f = "No";
        }
      }
    }
    System.out.println(f);

    sc.close();
  } main {
    Scanner sc = new Scanner(System.in);
    
    int[][] a = new int[3][3];
    int[] x = new int[3];
    int[] y = new int[3];
    int max = Integer.MIN_VALUE;
    for(int i=0; i<3; i++){
      for(int j=0; j<3; j++){
        a[i][j] = sc.nextInt();
        if(a[i][j] > max){
          max = a[i][j];
        }
      }
    }
    String f = "Yes";
    
    x[0] = 0;
    for(int j=0; j<3; j++){
      y[j] = a[0][j] - x[0];
    }
    for(int j=0; j<3; j++){
      x[j] = a[j][0] - y[0];
    }
    for(int i=0; i<3; i++){
      for(int j=0; j<3; j++){
        if(a[i][j] != x[i]+y[j]){
          f = "No";
        }
      }
    }
    System.out.println(f);

    sc.close();
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[][] a = new int[3][3]; a new int[3][3] 3 3 int[] x = new int[3]; x new int[3] 3 int[] y = new int[3]; y new int[3] 3 int max = Integer.MIN_VALUE; max Integer.MIN_VALUE Integer Integer.MIN_VALUE for(int i=0; i<3; i++){
      for(int j=0; j<3; j++){
        a[i][j] = sc.nextInt();
        if(a[i][j] > max){
          max = a[i][j];
        }
      }
    } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
      for(int j=0; j<3; j++){
        a[i][j] = sc.nextInt();
        if(a[i][j] > max){
          max = a[i][j];
        }
      }
    } {
      for(int j=0; j<3; j++){
        a[i][j] = sc.nextInt();
        if(a[i][j] > max){
          max = a[i][j];
        }
      }
    } for(int j=0; j<3; j++){
        a[i][j] = sc.nextInt();
        if(a[i][j] > max){
          max = a[i][j];
        }
      } int j=0; int j=0; j 0 j<3 j 3 j++ j++ j {
        a[i][j] = sc.nextInt();
        if(a[i][j] > max){
          max = a[i][j];
        }
      } {
        a[i][j] = sc.nextInt();
        if(a[i][j] > max){
          max = a[i][j];
        }
      } a[i][j] = sc.nextInt() a[i][j] a[i] a i j sc.nextInt() sc.nextInt sc if(a[i][j] > max){
          max = a[i][j];
        } a[i][j] > max a[i][j] a[i] a i j max {
          max = a[i][j];
        } max = a[i][j] max a[i][j] a[i] a i j String f = "Yes"; f "Yes" x[0] = 0 x[0] x 0 0 for(int j=0; j<3; j++){
      y[j] = a[0][j] - x[0];
    } int j=0; int j=0; j 0 j<3 j 3 j++ j++ j {
      y[j] = a[0][j] - x[0];
    } {
      y[j] = a[0][j] - x[0];
    } y[j] = a[0][j] - x[0] y[j] y j a[0][j] - x[0] a[0][j] a[0] a 0 j x[0] x 0 for(int j=0; j<3; j++){
      x[j] = a[j][0] - y[0];
    } int j=0; int j=0; j 0 j<3 j 3 j++ j++ j {
      x[j] = a[j][0] - y[0];
    } {
      x[j] = a[j][0] - y[0];
    } x[j] = a[j][0] - y[0] x[j] x j a[j][0] - y[0] a[j][0] a[j] a j 0 y[0] y 0 for(int i=0; i<3; i++){
      for(int j=0; j<3; j++){
        if(a[i][j] != x[i]+y[j]){
          f = "No";
        }
      }
    } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
      for(int j=0; j<3; j++){
        if(a[i][j] != x[i]+y[j]){
          f = "No";
        }
      }
    } {
      for(int j=0; j<3; j++){
        if(a[i][j] != x[i]+y[j]){
          f = "No";
        }
      }
    } for(int j=0; j<3; j++){
        if(a[i][j] != x[i]+y[j]){
          f = "No";
        }
      } int j=0; int j=0; j 0 j<3 j 3 j++ j++ j {
        if(a[i][j] != x[i]+y[j]){
          f = "No";
        }
      } {
        if(a[i][j] != x[i]+y[j]){
          f = "No";
        }
      } if(a[i][j] != x[i]+y[j]){
          f = "No";
        } a[i][j] != x[i]+y[j] a[i][j] a[i] a i j x[i]+y[j] x[i] x i y[j] y j {
          f = "No";
        } f = "No" f "No" System.out.println(f) System.out.println System.out System System.out f sc.close() sc.close sc String[] args args
import java.util.*;
 
class Main{
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    
    int[][] a = new int[3][3];
    int[] x = new int[3];
    int[] y = new int[3];
    int max = Integer.MIN_VALUE;
    for(int i=0; i<3; i++){
      for(int j=0; j<3; j++){
        a[i][j] = sc.nextInt();
        if(a[i][j] > max){
          max = a[i][j];
        }
      }
    }
    String f = "Yes";
    
    x[0] = 0;
    for(int j=0; j<3; j++){
      y[j] = a[0][j] - x[0];
    }
    for(int j=0; j<3; j++){
      x[j] = a[j][0] - y[0];
    }
    for(int i=0; i<3; i++){
      for(int j=0; j<3; j++){
        if(a[i][j] != x[i]+y[j]){
          f = "No";
        }
      }
    }
    System.out.println(f);

    sc.close();
  }
}
