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

public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int[][] c = new int[3][3];
    int[] r = new int[3];
    boolean flag = true;

    for(int i = 0; i < 3; i++){
      for(int j = 0; j < 3; j++){
        c[i][j] = scan.nextInt();
      }
    }

    outside:for(int i = 0; i < 3; i++){
      int a = 101;
      for(int j = 0; j < 3; j++){
        a = Math.min(c[i][j], a);
      }
      if(i == 0){
        for(int j = 0; j < 3; j++){
          r[j] = c[i][j] - a;
        }
      }
      if(i > 0){
        for(int j = 0; j < 3; j++){
          if(r[j] != c[i][j]-a){
            flag = false;
            System.out.println("No");
            break outside;
          }
        }
      }
    }

    if(flag == true){System.out.println("Yes");}
  }
} import java.util.*; util.* java import java.io.*; io.* java public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int[][] c = new int[3][3];
    int[] r = new int[3];
    boolean flag = true;

    for(int i = 0; i < 3; i++){
      for(int j = 0; j < 3; j++){
        c[i][j] = scan.nextInt();
      }
    }

    outside:for(int i = 0; i < 3; i++){
      int a = 101;
      for(int j = 0; j < 3; j++){
        a = Math.min(c[i][j], a);
      }
      if(i == 0){
        for(int j = 0; j < 3; j++){
          r[j] = c[i][j] - a;
        }
      }
      if(i > 0){
        for(int j = 0; j < 3; j++){
          if(r[j] != c[i][j]-a){
            flag = false;
            System.out.println("No");
            break outside;
          }
        }
      }
    }

    if(flag == true){System.out.println("Yes");}
  }
} Main public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int[][] c = new int[3][3];
    int[] r = new int[3];
    boolean flag = true;

    for(int i = 0; i < 3; i++){
      for(int j = 0; j < 3; j++){
        c[i][j] = scan.nextInt();
      }
    }

    outside:for(int i = 0; i < 3; i++){
      int a = 101;
      for(int j = 0; j < 3; j++){
        a = Math.min(c[i][j], a);
      }
      if(i == 0){
        for(int j = 0; j < 3; j++){
          r[j] = c[i][j] - a;
        }
      }
      if(i > 0){
        for(int j = 0; j < 3; j++){
          if(r[j] != c[i][j]-a){
            flag = false;
            System.out.println("No");
            break outside;
          }
        }
      }
    }

    if(flag == true){System.out.println("Yes");}
  } main {
    Scanner scan = new Scanner(System.in);
    int[][] c = new int[3][3];
    int[] r = new int[3];
    boolean flag = true;

    for(int i = 0; i < 3; i++){
      for(int j = 0; j < 3; j++){
        c[i][j] = scan.nextInt();
      }
    }

    outside:for(int i = 0; i < 3; i++){
      int a = 101;
      for(int j = 0; j < 3; j++){
        a = Math.min(c[i][j], a);
      }
      if(i == 0){
        for(int j = 0; j < 3; j++){
          r[j] = c[i][j] - a;
        }
      }
      if(i > 0){
        for(int j = 0; j < 3; j++){
          if(r[j] != c[i][j]-a){
            flag = false;
            System.out.println("No");
            break outside;
          }
        }
      }
    }

    if(flag == true){System.out.println("Yes");}
  } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int[][] c = new int[3][3]; c new int[3][3] 3 3 int[] r = new int[3]; r new int[3] 3 boolean flag = true; flag true for(int i = 0; i < 3; i++){
      for(int j = 0; j < 3; j++){
        c[i][j] = scan.nextInt();
      }
    } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
      for(int j = 0; j < 3; j++){
        c[i][j] = scan.nextInt();
      }
    } {
      for(int j = 0; j < 3; j++){
        c[i][j] = scan.nextInt();
      }
    } for(int j = 0; j < 3; j++){
        c[i][j] = scan.nextInt();
      } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
        c[i][j] = scan.nextInt();
      } {
        c[i][j] = scan.nextInt();
      } c[i][j] = scan.nextInt() c[i][j] c[i] c i j scan.nextInt() scan.nextInt scan if(flag == true){System.out.println("Yes");} flag == true flag true {System.out.println("Yes");} System.out.println("Yes") System.out.println System.out System System.out "Yes" String[] args args public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int[][] c = new int[3][3];
    int[] r = new int[3];
    boolean flag = true;

    for(int i = 0; i < 3; i++){
      for(int j = 0; j < 3; j++){
        c[i][j] = scan.nextInt();
      }
    }

    outside:for(int i = 0; i < 3; i++){
      int a = 101;
      for(int j = 0; j < 3; j++){
        a = Math.min(c[i][j], a);
      }
      if(i == 0){
        for(int j = 0; j < 3; j++){
          r[j] = c[i][j] - a;
        }
      }
      if(i > 0){
        for(int j = 0; j < 3; j++){
          if(r[j] != c[i][j]-a){
            flag = false;
            System.out.println("No");
            break outside;
          }
        }
      }
    }

    if(flag == true){System.out.println("Yes");}
  }
} public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int[][] c = new int[3][3];
    int[] r = new int[3];
    boolean flag = true;

    for(int i = 0; i < 3; i++){
      for(int j = 0; j < 3; j++){
        c[i][j] = scan.nextInt();
      }
    }

    outside:for(int i = 0; i < 3; i++){
      int a = 101;
      for(int j = 0; j < 3; j++){
        a = Math.min(c[i][j], a);
      }
      if(i == 0){
        for(int j = 0; j < 3; j++){
          r[j] = c[i][j] - a;
        }
      }
      if(i > 0){
        for(int j = 0; j < 3; j++){
          if(r[j] != c[i][j]-a){
            flag = false;
            System.out.println("No");
            break outside;
          }
        }
      }
    }

    if(flag == true){System.out.println("Yes");}
  }
} Main
import java.util.*;
import java.io.*;

public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int[][] c = new int[3][3];
    int[] r = new int[3];
    boolean flag = true;

    for(int i = 0; i < 3; i++){
      for(int j = 0; j < 3; j++){
        c[i][j] = scan.nextInt();
      }
    }

    outside:for(int i = 0; i < 3; i++){
      int a = 101;
      for(int j = 0; j < 3; j++){
        a = Math.min(c[i][j], a);
      }
      if(i == 0){
        for(int j = 0; j < 3; j++){
          r[j] = c[i][j] - a;
        }
      }
      if(i > 0){
        for(int j = 0; j < 3; j++){
          if(r[j] != c[i][j]-a){
            flag = false;
            System.out.println("No");
            break outside;
          }
        }
      }
    }

    if(flag == true){System.out.println("Yes");}
  }
}
