//youtubeの解説動画を見て書きました。
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[] rx = new int[3];
    int[] ry = 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();
      }
    }

    ry[0] = 0;
    for(int j = 0; j < 3; j++){rx[j] = c[0][j] - ry[0];}
    for(int j = 1; j < 3; j++){ry[j] = c[j][0] - rx[0];}

    outside:for(int i = 0; i < 3; i++){
      for(int j = 0; j < 3; j++){
        if(rx[j]+ry[i] != c[i][j]){
          flag = false;
          System.out.println("No");
          break outside;
        }
      }
    }

    if(flag){System.out.println("Yes");}
  }
}
//aを決めてしまえば他も決まるという発想は合っていたが、
//aの決め方が理解できていなかったなという感じ。
/*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[] rx = new int[3];
    int[] ry = 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();
      }
    }

    ry[0] = 0;
    for(int j = 0; j < 3; j++){rx[j] = c[0][j] - ry[0];}
    for(int j = 1; j < 3; j++){ry[j] = c[j][0] - rx[0];}

    outside:for(int i = 0; i < 3; i++){
      for(int j = 0; j < 3; j++){
        if(rx[j]+ry[i] != c[i][j]){
          flag = false;
          System.out.println("No");
          break outside;
        }
      }
    }

    if(flag){System.out.println("Yes");}
  }
} Main public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int[][] c = new int[3][3];
    int[] rx = new int[3];
    int[] ry = 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();
      }
    }

    ry[0] = 0;
    for(int j = 0; j < 3; j++){rx[j] = c[0][j] - ry[0];}
    for(int j = 1; j < 3; j++){ry[j] = c[j][0] - rx[0];}

    outside:for(int i = 0; i < 3; i++){
      for(int j = 0; j < 3; j++){
        if(rx[j]+ry[i] != c[i][j]){
          flag = false;
          System.out.println("No");
          break outside;
        }
      }
    }

    if(flag){System.out.println("Yes");}
  } main {
    Scanner scan = new Scanner(System.in);
    int[][] c = new int[3][3];
    int[] rx = new int[3];
    int[] ry = 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();
      }
    }

    ry[0] = 0;
    for(int j = 0; j < 3; j++){rx[j] = c[0][j] - ry[0];}
    for(int j = 1; j < 3; j++){ry[j] = c[j][0] - rx[0];}

    outside:for(int i = 0; i < 3; i++){
      for(int j = 0; j < 3; j++){
        if(rx[j]+ry[i] != c[i][j]){
          flag = false;
          System.out.println("No");
          break outside;
        }
      }
    }

    if(flag){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[] rx = new int[3]; rx new int[3] 3 int[] ry = new int[3]; ry 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 ry[0] = 0 ry[0] ry 0 0 for(int j = 0; j < 3; j++){rx[j] = c[0][j] - ry[0];} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {rx[j] = c[0][j] - ry[0];} {rx[j] = c[0][j] - ry[0];} rx[j] = c[0][j] - ry[0] rx[j] rx j c[0][j] - ry[0] c[0][j] c[0] c 0 j ry[0] ry 0 for(int j = 1; j < 3; j++){ry[j] = c[j][0] - rx[0];} int j = 1; int j = 1; j 1 j < 3 j 3 j++ j++ j {ry[j] = c[j][0] - rx[0];} {ry[j] = c[j][0] - rx[0];} ry[j] = c[j][0] - rx[0] ry[j] ry j c[j][0] - rx[0] c[j][0] c[j] c j 0 rx[0] rx 0 if(flag){System.out.println("Yes");} flag {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[] rx = new int[3];
    int[] ry = 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();
      }
    }

    ry[0] = 0;
    for(int j = 0; j < 3; j++){rx[j] = c[0][j] - ry[0];}
    for(int j = 1; j < 3; j++){ry[j] = c[j][0] - rx[0];}

    outside:for(int i = 0; i < 3; i++){
      for(int j = 0; j < 3; j++){
        if(rx[j]+ry[i] != c[i][j]){
          flag = false;
          System.out.println("No");
          break outside;
        }
      }
    }

    if(flag){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[] rx = new int[3];
    int[] ry = 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();
      }
    }

    ry[0] = 0;
    for(int j = 0; j < 3; j++){rx[j] = c[0][j] - ry[0];}
    for(int j = 1; j < 3; j++){ry[j] = c[j][0] - rx[0];}

    outside:for(int i = 0; i < 3; i++){
      for(int j = 0; j < 3; j++){
        if(rx[j]+ry[i] != c[i][j]){
          flag = false;
          System.out.println("No");
          break outside;
        }
      }
    }

    if(flag){System.out.println("Yes");}
  }
} Main
//youtubeの解説動画を見て書きました。
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[] rx = new int[3];
    int[] ry = 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();
      }
    }

    ry[0] = 0;
    for(int j = 0; j < 3; j++){rx[j] = c[0][j] - ry[0];}
    for(int j = 1; j < 3; j++){ry[j] = c[j][0] - rx[0];}

    outside:for(int i = 0; i < 3; i++){
      for(int j = 0; j < 3; j++){
        if(rx[j]+ry[i] != c[i][j]){
          flag = false;
          System.out.println("No");
          break outside;
        }
      }
    }

    if(flag){System.out.println("Yes");}
  }
}
//aを決めてしまえば他も決まるという発想は合っていたが、
//aの決め方が理解できていなかったなという感じ。
/*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");}*/
