import java.util.*;

class Main {
   public static void main(String[] args)
   {
      Scanner scan = new Scanner(System.in);

      int A = 0;
      int B = 0;
      int C;

      int[][] Card = new int[3][3];
      for(int i = 0; i < 3; i++){
          for(int j = 0; j < 3; j++){
              Card[i][j] = scan.nextInt();
              }
          }
      A = Card[0][0] - Card[0][1];
      B = Card[0][0] - Card[0][2];
      C = Card[0][1] - Card[0][2];

      for(int i = 1; i < 3; i++){
          if(A != Card[i][0] - Card[i][1] || B != Card[i][0] - Card[i][2] || C != Card[i][1] - Card[i][2]){
             System.out.println("No");
             return;
             }
          }

      System.out.println("Yes");
   }
} import java.util.*; util.* java class Main {
   public static void main(String[] args)
   {
      Scanner scan = new Scanner(System.in);

      int A = 0;
      int B = 0;
      int C;

      int[][] Card = new int[3][3];
      for(int i = 0; i < 3; i++){
          for(int j = 0; j < 3; j++){
              Card[i][j] = scan.nextInt();
              }
          }
      A = Card[0][0] - Card[0][1];
      B = Card[0][0] - Card[0][2];
      C = Card[0][1] - Card[0][2];

      for(int i = 1; i < 3; i++){
          if(A != Card[i][0] - Card[i][1] || B != Card[i][0] - Card[i][2] || C != Card[i][1] - Card[i][2]){
             System.out.println("No");
             return;
             }
          }

      System.out.println("Yes");
   }
} Main public static void main(String[] args)
   {
      Scanner scan = new Scanner(System.in);

      int A = 0;
      int B = 0;
      int C;

      int[][] Card = new int[3][3];
      for(int i = 0; i < 3; i++){
          for(int j = 0; j < 3; j++){
              Card[i][j] = scan.nextInt();
              }
          }
      A = Card[0][0] - Card[0][1];
      B = Card[0][0] - Card[0][2];
      C = Card[0][1] - Card[0][2];

      for(int i = 1; i < 3; i++){
          if(A != Card[i][0] - Card[i][1] || B != Card[i][0] - Card[i][2] || C != Card[i][1] - Card[i][2]){
             System.out.println("No");
             return;
             }
          }

      System.out.println("Yes");
   } main {
      Scanner scan = new Scanner(System.in);

      int A = 0;
      int B = 0;
      int C;

      int[][] Card = new int[3][3];
      for(int i = 0; i < 3; i++){
          for(int j = 0; j < 3; j++){
              Card[i][j] = scan.nextInt();
              }
          }
      A = Card[0][0] - Card[0][1];
      B = Card[0][0] - Card[0][2];
      C = Card[0][1] - Card[0][2];

      for(int i = 1; i < 3; i++){
          if(A != Card[i][0] - Card[i][1] || B != Card[i][0] - Card[i][2] || C != Card[i][1] - Card[i][2]){
             System.out.println("No");
             return;
             }
          }

      System.out.println("Yes");
   } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int A = 0; A 0 int B = 0; B 0 int C; C int[][] Card = new int[3][3]; Card new int[3][3] 3 3 for(int i = 0; i < 3; i++){
          for(int j = 0; j < 3; j++){
              Card[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++){
              Card[i][j] = scan.nextInt();
              }
          } {
          for(int j = 0; j < 3; j++){
              Card[i][j] = scan.nextInt();
              }
          } for(int j = 0; j < 3; j++){
              Card[i][j] = scan.nextInt();
              } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
              Card[i][j] = scan.nextInt();
              } {
              Card[i][j] = scan.nextInt();
              } Card[i][j] = scan.nextInt() Card[i][j] Card[i] Card i j scan.nextInt() scan.nextInt scan A = Card[0][0] - Card[0][1] A Card[0][0] - Card[0][1] Card[0][0] Card[0] Card 0 0 Card[0][1] Card[0] Card 0 1 B = Card[0][0] - Card[0][2] B Card[0][0] - Card[0][2] Card[0][0] Card[0] Card 0 0 Card[0][2] Card[0] Card 0 2 C = Card[0][1] - Card[0][2] C Card[0][1] - Card[0][2] Card[0][1] Card[0] Card 0 1 Card[0][2] Card[0] Card 0 2 for(int i = 1; i < 3; i++){
          if(A != Card[i][0] - Card[i][1] || B != Card[i][0] - Card[i][2] || C != Card[i][1] - Card[i][2]){
             System.out.println("No");
             return;
             }
          } int i = 1; int i = 1; i 1 i < 3 i 3 i++ i++ i {
          if(A != Card[i][0] - Card[i][1] || B != Card[i][0] - Card[i][2] || C != Card[i][1] - Card[i][2]){
             System.out.println("No");
             return;
             }
          } {
          if(A != Card[i][0] - Card[i][1] || B != Card[i][0] - Card[i][2] || C != Card[i][1] - Card[i][2]){
             System.out.println("No");
             return;
             }
          } if(A != Card[i][0] - Card[i][1] || B != Card[i][0] - Card[i][2] || C != Card[i][1] - Card[i][2]){
             System.out.println("No");
             return;
             } A != Card[i][0] - Card[i][1] || B != Card[i][0] - Card[i][2] || C != Card[i][1] - Card[i][2] A != Card[i][0] - Card[i][1] || B != Card[i][0] - Card[i][2] || C != Card[i][1] - Card[i][2] A != Card[i][0] - Card[i][1] A Card[i][0] - Card[i][1] Card[i][0] Card[i] Card i 0 Card[i][1] Card[i] Card i 1 B != Card[i][0] - Card[i][2] B Card[i][0] - Card[i][2] Card[i][0] Card[i] Card i 0 Card[i][2] Card[i] Card i 2 C != Card[i][1] - Card[i][2] C Card[i][1] - Card[i][2] Card[i][1] Card[i] Card i 1 Card[i][2] Card[i] Card i 2 {
             System.out.println("No");
             return;
             } System.out.println("No") System.out.println System.out System System.out "No" return; System.out.println("Yes") System.out.println System.out System System.out "Yes" String[] args args
import java.util.*;

class Main {
   public static void main(String[] args)
   {
      Scanner scan = new Scanner(System.in);

      int A = 0;
      int B = 0;
      int C;

      int[][] Card = new int[3][3];
      for(int i = 0; i < 3; i++){
          for(int j = 0; j < 3; j++){
              Card[i][j] = scan.nextInt();
              }
          }
      A = Card[0][0] - Card[0][1];
      B = Card[0][0] - Card[0][2];
      C = Card[0][1] - Card[0][2];

      for(int i = 1; i < 3; i++){
          if(A != Card[i][0] - Card[i][1] || B != Card[i][0] - Card[i][2] || C != Card[i][1] - Card[i][2]){
             System.out.println("No");
             return;
             }
          }

      System.out.println("Yes");
   }
}
