import java.util.*;

public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    int[][] c = new int[3][3];

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

    sc.close();

    int b0b1_1 = c[0][0] - c[0][1];
    int b1b2_1 = c[0][1] - c[0][2];

    int b0b1_2 = c[1][0] - c[1][1];
    int b1b2_2 = c[1][1] - c[1][2];
    
    int b0b1_3 = c[2][0] - c[2][1];
    int b1b2_3 = c[2][1] - c[2][2];
    
    int a0a1_1 = c[0][0] - c[1][0];
    int a1a2_1 = c[1][0] - c[2][0];
    
    int a0a1_2 = c[0][1] - c[1][1];
    int a1a2_2 = c[1][1] - c[2][1];
    
    int a0a1_3 = c[0][2] - c[1][2];
    int a1a2_3 = c[1][2] - c[2][2];

    String result = "No";

    if (b0b1_1 == b0b1_2 && b0b1_2 == b0b1_3) {
      if (b1b2_1 == b1b2_2 && b1b2_2 == b1b2_3) {
        if (a0a1_1 == a0a1_2 && a0a1_2 == a0a1_3) {
          if (a1a2_1 == a1a2_2 && a1a2_2 == a1a2_3) {
            result = "Yes";
          }
        }
      }
    }

    System.out.println(result);

  }

} import java.util.*; util.* java public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    int[][] c = new int[3][3];

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

    sc.close();

    int b0b1_1 = c[0][0] - c[0][1];
    int b1b2_1 = c[0][1] - c[0][2];

    int b0b1_2 = c[1][0] - c[1][1];
    int b1b2_2 = c[1][1] - c[1][2];
    
    int b0b1_3 = c[2][0] - c[2][1];
    int b1b2_3 = c[2][1] - c[2][2];
    
    int a0a1_1 = c[0][0] - c[1][0];
    int a1a2_1 = c[1][0] - c[2][0];
    
    int a0a1_2 = c[0][1] - c[1][1];
    int a1a2_2 = c[1][1] - c[2][1];
    
    int a0a1_3 = c[0][2] - c[1][2];
    int a1a2_3 = c[1][2] - c[2][2];

    String result = "No";

    if (b0b1_1 == b0b1_2 && b0b1_2 == b0b1_3) {
      if (b1b2_1 == b1b2_2 && b1b2_2 == b1b2_3) {
        if (a0a1_1 == a0a1_2 && a0a1_2 == a0a1_3) {
          if (a1a2_1 == a1a2_2 && a1a2_2 == a1a2_3) {
            result = "Yes";
          }
        }
      }
    }

    System.out.println(result);

  }

} Main public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    int[][] c = new int[3][3];

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

    sc.close();

    int b0b1_1 = c[0][0] - c[0][1];
    int b1b2_1 = c[0][1] - c[0][2];

    int b0b1_2 = c[1][0] - c[1][1];
    int b1b2_2 = c[1][1] - c[1][2];
    
    int b0b1_3 = c[2][0] - c[2][1];
    int b1b2_3 = c[2][1] - c[2][2];
    
    int a0a1_1 = c[0][0] - c[1][0];
    int a1a2_1 = c[1][0] - c[2][0];
    
    int a0a1_2 = c[0][1] - c[1][1];
    int a1a2_2 = c[1][1] - c[2][1];
    
    int a0a1_3 = c[0][2] - c[1][2];
    int a1a2_3 = c[1][2] - c[2][2];

    String result = "No";

    if (b0b1_1 == b0b1_2 && b0b1_2 == b0b1_3) {
      if (b1b2_1 == b1b2_2 && b1b2_2 == b1b2_3) {
        if (a0a1_1 == a0a1_2 && a0a1_2 == a0a1_3) {
          if (a1a2_1 == a1a2_2 && a1a2_2 == a1a2_3) {
            result = "Yes";
          }
        }
      }
    }

    System.out.println(result);

  } main {

    Scanner sc = new Scanner(System.in);

    int[][] c = new int[3][3];

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

    sc.close();

    int b0b1_1 = c[0][0] - c[0][1];
    int b1b2_1 = c[0][1] - c[0][2];

    int b0b1_2 = c[1][0] - c[1][1];
    int b1b2_2 = c[1][1] - c[1][2];
    
    int b0b1_3 = c[2][0] - c[2][1];
    int b1b2_3 = c[2][1] - c[2][2];
    
    int a0a1_1 = c[0][0] - c[1][0];
    int a1a2_1 = c[1][0] - c[2][0];
    
    int a0a1_2 = c[0][1] - c[1][1];
    int a1a2_2 = c[1][1] - c[2][1];
    
    int a0a1_3 = c[0][2] - c[1][2];
    int a1a2_3 = c[1][2] - c[2][2];

    String result = "No";

    if (b0b1_1 == b0b1_2 && b0b1_2 == b0b1_3) {
      if (b1b2_1 == b1b2_2 && b1b2_2 == b1b2_3) {
        if (a0a1_1 == a0a1_2 && a0a1_2 == a0a1_3) {
          if (a1a2_1 == a1a2_2 && a1a2_2 == a1a2_3) {
            result = "Yes";
          }
        }
      }
    }

    System.out.println(result);

  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[][] c = new int[3][3]; c new int[3][3] 3 3 for (int i = 0; i < 3; i++) {
      for (int j = 0; j < 3; j++) {
        c[i][j] = sc.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] = sc.nextInt();
      }
    } {
      for (int j = 0; j < 3; j++) {
        c[i][j] = sc.nextInt();
      }
    } for (int j = 0; j < 3; j++) {
        c[i][j] = sc.nextInt();
      } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
        c[i][j] = sc.nextInt();
      } {
        c[i][j] = sc.nextInt();
      } c[i][j] = sc.nextInt() c[i][j] c[i] c i j sc.nextInt() sc.nextInt sc sc.close() sc.close sc int b0b1_1 = c[0][0] - c[0][1]; b0b1_1 c[0][0] - c[0][1] c[0][0] c[0] c 0 0 c[0][1] c[0] c 0 1 int b1b2_1 = c[0][1] - c[0][2]; b1b2_1 c[0][1] - c[0][2] c[0][1] c[0] c 0 1 c[0][2] c[0] c 0 2 int b0b1_2 = c[1][0] - c[1][1]; b0b1_2 c[1][0] - c[1][1] c[1][0] c[1] c 1 0 c[1][1] c[1] c 1 1 int b1b2_2 = c[1][1] - c[1][2]; b1b2_2 c[1][1] - c[1][2] c[1][1] c[1] c 1 1 c[1][2] c[1] c 1 2 int b0b1_3 = c[2][0] - c[2][1]; b0b1_3 c[2][0] - c[2][1] c[2][0] c[2] c 2 0 c[2][1] c[2] c 2 1 int b1b2_3 = c[2][1] - c[2][2]; b1b2_3 c[2][1] - c[2][2] c[2][1] c[2] c 2 1 c[2][2] c[2] c 2 2 int a0a1_1 = c[0][0] - c[1][0]; a0a1_1 c[0][0] - c[1][0] c[0][0] c[0] c 0 0 c[1][0] c[1] c 1 0 int a1a2_1 = c[1][0] - c[2][0]; a1a2_1 c[1][0] - c[2][0] c[1][0] c[1] c 1 0 c[2][0] c[2] c 2 0 int a0a1_2 = c[0][1] - c[1][1]; a0a1_2 c[0][1] - c[1][1] c[0][1] c[0] c 0 1 c[1][1] c[1] c 1 1 int a1a2_2 = c[1][1] - c[2][1]; a1a2_2 c[1][1] - c[2][1] c[1][1] c[1] c 1 1 c[2][1] c[2] c 2 1 int a0a1_3 = c[0][2] - c[1][2]; a0a1_3 c[0][2] - c[1][2] c[0][2] c[0] c 0 2 c[1][2] c[1] c 1 2 int a1a2_3 = c[1][2] - c[2][2]; a1a2_3 c[1][2] - c[2][2] c[1][2] c[1] c 1 2 c[2][2] c[2] c 2 2 String result = "No"; result "No" if (b0b1_1 == b0b1_2 && b0b1_2 == b0b1_3) {
      if (b1b2_1 == b1b2_2 && b1b2_2 == b1b2_3) {
        if (a0a1_1 == a0a1_2 && a0a1_2 == a0a1_3) {
          if (a1a2_1 == a1a2_2 && a1a2_2 == a1a2_3) {
            result = "Yes";
          }
        }
      }
    } b0b1_1 == b0b1_2 && b0b1_2 == b0b1_3 b0b1_1 == b0b1_2 b0b1_1 b0b1_2 b0b1_2 == b0b1_3 b0b1_2 b0b1_3 {
      if (b1b2_1 == b1b2_2 && b1b2_2 == b1b2_3) {
        if (a0a1_1 == a0a1_2 && a0a1_2 == a0a1_3) {
          if (a1a2_1 == a1a2_2 && a1a2_2 == a1a2_3) {
            result = "Yes";
          }
        }
      }
    } if (b1b2_1 == b1b2_2 && b1b2_2 == b1b2_3) {
        if (a0a1_1 == a0a1_2 && a0a1_2 == a0a1_3) {
          if (a1a2_1 == a1a2_2 && a1a2_2 == a1a2_3) {
            result = "Yes";
          }
        }
      } b1b2_1 == b1b2_2 && b1b2_2 == b1b2_3 b1b2_1 == b1b2_2 b1b2_1 b1b2_2 b1b2_2 == b1b2_3 b1b2_2 b1b2_3 {
        if (a0a1_1 == a0a1_2 && a0a1_2 == a0a1_3) {
          if (a1a2_1 == a1a2_2 && a1a2_2 == a1a2_3) {
            result = "Yes";
          }
        }
      } if (a0a1_1 == a0a1_2 && a0a1_2 == a0a1_3) {
          if (a1a2_1 == a1a2_2 && a1a2_2 == a1a2_3) {
            result = "Yes";
          }
        } a0a1_1 == a0a1_2 && a0a1_2 == a0a1_3 a0a1_1 == a0a1_2 a0a1_1 a0a1_2 a0a1_2 == a0a1_3 a0a1_2 a0a1_3 {
          if (a1a2_1 == a1a2_2 && a1a2_2 == a1a2_3) {
            result = "Yes";
          }
        } if (a1a2_1 == a1a2_2 && a1a2_2 == a1a2_3) {
            result = "Yes";
          } a1a2_1 == a1a2_2 && a1a2_2 == a1a2_3 a1a2_1 == a1a2_2 a1a2_1 a1a2_2 a1a2_2 == a1a2_3 a1a2_2 a1a2_3 {
            result = "Yes";
          } result = "Yes" result "Yes" System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    int[][] c = new int[3][3];

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

    sc.close();

    int b0b1_1 = c[0][0] - c[0][1];
    int b1b2_1 = c[0][1] - c[0][2];

    int b0b1_2 = c[1][0] - c[1][1];
    int b1b2_2 = c[1][1] - c[1][2];
    
    int b0b1_3 = c[2][0] - c[2][1];
    int b1b2_3 = c[2][1] - c[2][2];
    
    int a0a1_1 = c[0][0] - c[1][0];
    int a1a2_1 = c[1][0] - c[2][0];
    
    int a0a1_2 = c[0][1] - c[1][1];
    int a1a2_2 = c[1][1] - c[2][1];
    
    int a0a1_3 = c[0][2] - c[1][2];
    int a1a2_3 = c[1][2] - c[2][2];

    String result = "No";

    if (b0b1_1 == b0b1_2 && b0b1_2 == b0b1_3) {
      if (b1b2_1 == b1b2_2 && b1b2_2 == b1b2_3) {
        if (a0a1_1 == a0a1_2 && a0a1_2 == a0a1_3) {
          if (a1a2_1 == a1a2_2 && a1a2_2 == a1a2_3) {
            result = "Yes";
          }
        }
      }
    }

    System.out.println(result);

  }

} public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    int[][] c = new int[3][3];

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

    sc.close();

    int b0b1_1 = c[0][0] - c[0][1];
    int b1b2_1 = c[0][1] - c[0][2];

    int b0b1_2 = c[1][0] - c[1][1];
    int b1b2_2 = c[1][1] - c[1][2];
    
    int b0b1_3 = c[2][0] - c[2][1];
    int b1b2_3 = c[2][1] - c[2][2];
    
    int a0a1_1 = c[0][0] - c[1][0];
    int a1a2_1 = c[1][0] - c[2][0];
    
    int a0a1_2 = c[0][1] - c[1][1];
    int a1a2_2 = c[1][1] - c[2][1];
    
    int a0a1_3 = c[0][2] - c[1][2];
    int a1a2_3 = c[1][2] - c[2][2];

    String result = "No";

    if (b0b1_1 == b0b1_2 && b0b1_2 == b0b1_3) {
      if (b1b2_1 == b1b2_2 && b1b2_2 == b1b2_3) {
        if (a0a1_1 == a0a1_2 && a0a1_2 == a0a1_3) {
          if (a1a2_1 == a1a2_2 && a1a2_2 == a1a2_3) {
            result = "Yes";
          }
        }
      }
    }

    System.out.println(result);

  }

} Main
import java.util.*;

public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    int[][] c = new int[3][3];

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

    sc.close();

    int b0b1_1 = c[0][0] - c[0][1];
    int b1b2_1 = c[0][1] - c[0][2];

    int b0b1_2 = c[1][0] - c[1][1];
    int b1b2_2 = c[1][1] - c[1][2];
    
    int b0b1_3 = c[2][0] - c[2][1];
    int b1b2_3 = c[2][1] - c[2][2];
    
    int a0a1_1 = c[0][0] - c[1][0];
    int a1a2_1 = c[1][0] - c[2][0];
    
    int a0a1_2 = c[0][1] - c[1][1];
    int a1a2_2 = c[1][1] - c[2][1];
    
    int a0a1_3 = c[0][2] - c[1][2];
    int a1a2_3 = c[1][2] - c[2][2];

    String result = "No";

    if (b0b1_1 == b0b1_2 && b0b1_2 == b0b1_3) {
      if (b1b2_1 == b1b2_2 && b1b2_2 == b1b2_3) {
        if (a0a1_1 == a0a1_2 && a0a1_2 == a0a1_3) {
          if (a1a2_1 == a1a2_2 && a1a2_2 == a1a2_3) {
            result = "Yes";
          }
        }
      }
    }

    System.out.println(result);

  }

}