import java.util.Scanner;

public class Main {
  public static void main(String[] args) throws Exception {
    Scanner scanner = new Scanner(System.in);
    try {
      int[][] c = new int[3][3];
      for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
          c[i][j] = scanner.nextInt();
        }
      }
      
      for (int i = 0; i < 2; i++) {
        if (!check_h(c,i)) {
          System.out.println("No");
          return;
        }
      }
      
      for (int j = 0; j < 2; j++) {
        if (!check_v(c,j)) {
          System.out.println("No");
          return;
        }
      }
      
      System.out.println("Yes");
    }
    finally {
      scanner.close();
    }
  }

  private static boolean check_v(int[][] c, int j) {
    for (int i = 0; i < 2; i++) {
      if (c[i][j+1] - c[i][j] != c[i+1][j+1] - c[i+1][j]) return false;
    }
    return true;
  }

  private static boolean check_h(int[][] c, int i) {
    for (int j = 0; j < 2; j++) {
      if (c[i+1][j] - c[i][j] != c[i+1][j+1] - c[i][j+1]) return false;
    }
    return true;
  }
} import java.util.Scanner; Scanner java.util public class Main {
  public static void main(String[] args) throws Exception {
    Scanner scanner = new Scanner(System.in);
    try {
      int[][] c = new int[3][3];
      for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
          c[i][j] = scanner.nextInt();
        }
      }
      
      for (int i = 0; i < 2; i++) {
        if (!check_h(c,i)) {
          System.out.println("No");
          return;
        }
      }
      
      for (int j = 0; j < 2; j++) {
        if (!check_v(c,j)) {
          System.out.println("No");
          return;
        }
      }
      
      System.out.println("Yes");
    }
    finally {
      scanner.close();
    }
  }

  private static boolean check_v(int[][] c, int j) {
    for (int i = 0; i < 2; i++) {
      if (c[i][j+1] - c[i][j] != c[i+1][j+1] - c[i+1][j]) return false;
    }
    return true;
  }

  private static boolean check_h(int[][] c, int i) {
    for (int j = 0; j < 2; j++) {
      if (c[i+1][j] - c[i][j] != c[i+1][j+1] - c[i][j+1]) return false;
    }
    return true;
  }
} Main public static void main(String[] args) throws Exception {
    Scanner scanner = new Scanner(System.in);
    try {
      int[][] c = new int[3][3];
      for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
          c[i][j] = scanner.nextInt();
        }
      }
      
      for (int i = 0; i < 2; i++) {
        if (!check_h(c,i)) {
          System.out.println("No");
          return;
        }
      }
      
      for (int j = 0; j < 2; j++) {
        if (!check_v(c,j)) {
          System.out.println("No");
          return;
        }
      }
      
      System.out.println("Yes");
    }
    finally {
      scanner.close();
    }
  } main {
    Scanner scanner = new Scanner(System.in);
    try {
      int[][] c = new int[3][3];
      for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
          c[i][j] = scanner.nextInt();
        }
      }
      
      for (int i = 0; i < 2; i++) {
        if (!check_h(c,i)) {
          System.out.println("No");
          return;
        }
      }
      
      for (int j = 0; j < 2; j++) {
        if (!check_v(c,j)) {
          System.out.println("No");
          return;
        }
      }
      
      System.out.println("Yes");
    }
    finally {
      scanner.close();
    }
  } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) try {
      int[][] c = new int[3][3];
      for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
          c[i][j] = scanner.nextInt();
        }
      }
      
      for (int i = 0; i < 2; i++) {
        if (!check_h(c,i)) {
          System.out.println("No");
          return;
        }
      }
      
      for (int j = 0; j < 2; j++) {
        if (!check_v(c,j)) {
          System.out.println("No");
          return;
        }
      }
      
      System.out.println("Yes");
    }
    finally {
      scanner.close();
    } {
      scanner.close();
    } scanner.close() scanner.close scanner {
      int[][] c = new int[3][3];
      for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
          c[i][j] = scanner.nextInt();
        }
      }
      
      for (int i = 0; i < 2; i++) {
        if (!check_h(c,i)) {
          System.out.println("No");
          return;
        }
      }
      
      for (int j = 0; j < 2; j++) {
        if (!check_v(c,j)) {
          System.out.println("No");
          return;
        }
      }
      
      System.out.println("Yes");
    } 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] = scanner.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] = scanner.nextInt();
        }
      } {
        for (int j = 0; j < 3; j++) {
          c[i][j] = scanner.nextInt();
        }
      } for (int j = 0; j < 3; j++) {
          c[i][j] = scanner.nextInt();
        } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
          c[i][j] = scanner.nextInt();
        } {
          c[i][j] = scanner.nextInt();
        } c[i][j] = scanner.nextInt() c[i][j] c[i] c i j scanner.nextInt() scanner.nextInt scanner for (int i = 0; i < 2; i++) {
        if (!check_h(c,i)) {
          System.out.println("No");
          return;
        }
      } int i = 0; int i = 0; i 0 i < 2 i 2 i++ i++ i {
        if (!check_h(c,i)) {
          System.out.println("No");
          return;
        }
      } {
        if (!check_h(c,i)) {
          System.out.println("No");
          return;
        }
      } if (!check_h(c,i)) {
          System.out.println("No");
          return;
        } !check_h(c,i) check_h(c,i) check_h c i {
          System.out.println("No");
          return;
        } System.out.println("No") System.out.println System.out System System.out "No" return; for (int j = 0; j < 2; j++) {
        if (!check_v(c,j)) {
          System.out.println("No");
          return;
        }
      } int j = 0; int j = 0; j 0 j < 2 j 2 j++ j++ j {
        if (!check_v(c,j)) {
          System.out.println("No");
          return;
        }
      } {
        if (!check_v(c,j)) {
          System.out.println("No");
          return;
        }
      } if (!check_v(c,j)) {
          System.out.println("No");
          return;
        } !check_v(c,j) check_v(c,j) check_v c j {
          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 private static boolean check_v(int[][] c, int j) {
    for (int i = 0; i < 2; i++) {
      if (c[i][j+1] - c[i][j] != c[i+1][j+1] - c[i+1][j]) return false;
    }
    return true;
  } check_v {
    for (int i = 0; i < 2; i++) {
      if (c[i][j+1] - c[i][j] != c[i+1][j+1] - c[i+1][j]) return false;
    }
    return true;
  } for (int i = 0; i < 2; i++) {
      if (c[i][j+1] - c[i][j] != c[i+1][j+1] - c[i+1][j]) return false;
    } int i = 0; int i = 0; i 0 i < 2 i 2 i++ i++ i {
      if (c[i][j+1] - c[i][j] != c[i+1][j+1] - c[i+1][j]) return false;
    } {
      if (c[i][j+1] - c[i][j] != c[i+1][j+1] - c[i+1][j]) return false;
    } if (c[i][j+1] - c[i][j] != c[i+1][j+1] - c[i+1][j]) return false; c[i][j+1] - c[i][j] != c[i+1][j+1] - c[i+1][j] c[i][j+1] - c[i][j] c[i][j+1] c[i] c i j+1 j 1 c[i][j] c[i] c i j c[i+1][j+1] - c[i+1][j] c[i+1][j+1] c[i+1] c i+1 i 1 j+1 j 1 c[i+1][j] c[i+1] c i+1 i 1 j return false; false return true; true int[][] c c int j j private static boolean check_h(int[][] c, int i) {
    for (int j = 0; j < 2; j++) {
      if (c[i+1][j] - c[i][j] != c[i+1][j+1] - c[i][j+1]) return false;
    }
    return true;
  } check_h {
    for (int j = 0; j < 2; j++) {
      if (c[i+1][j] - c[i][j] != c[i+1][j+1] - c[i][j+1]) return false;
    }
    return true;
  } for (int j = 0; j < 2; j++) {
      if (c[i+1][j] - c[i][j] != c[i+1][j+1] - c[i][j+1]) return false;
    } int j = 0; int j = 0; j 0 j < 2 j 2 j++ j++ j {
      if (c[i+1][j] - c[i][j] != c[i+1][j+1] - c[i][j+1]) return false;
    } {
      if (c[i+1][j] - c[i][j] != c[i+1][j+1] - c[i][j+1]) return false;
    } if (c[i+1][j] - c[i][j] != c[i+1][j+1] - c[i][j+1]) return false; c[i+1][j] - c[i][j] != c[i+1][j+1] - c[i][j+1] c[i+1][j] - c[i][j] c[i+1][j] c[i+1] c i+1 i 1 j c[i][j] c[i] c i j c[i+1][j+1] - c[i][j+1] c[i+1][j+1] c[i+1] c i+1 i 1 j+1 j 1 c[i][j+1] c[i] c i j+1 j 1 return false; false return true; true int[][] c c int i i public class Main {
  public static void main(String[] args) throws Exception {
    Scanner scanner = new Scanner(System.in);
    try {
      int[][] c = new int[3][3];
      for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
          c[i][j] = scanner.nextInt();
        }
      }
      
      for (int i = 0; i < 2; i++) {
        if (!check_h(c,i)) {
          System.out.println("No");
          return;
        }
      }
      
      for (int j = 0; j < 2; j++) {
        if (!check_v(c,j)) {
          System.out.println("No");
          return;
        }
      }
      
      System.out.println("Yes");
    }
    finally {
      scanner.close();
    }
  }

  private static boolean check_v(int[][] c, int j) {
    for (int i = 0; i < 2; i++) {
      if (c[i][j+1] - c[i][j] != c[i+1][j+1] - c[i+1][j]) return false;
    }
    return true;
  }

  private static boolean check_h(int[][] c, int i) {
    for (int j = 0; j < 2; j++) {
      if (c[i+1][j] - c[i][j] != c[i+1][j+1] - c[i][j+1]) return false;
    }
    return true;
  }
} public class Main {
  public static void main(String[] args) throws Exception {
    Scanner scanner = new Scanner(System.in);
    try {
      int[][] c = new int[3][3];
      for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
          c[i][j] = scanner.nextInt();
        }
      }
      
      for (int i = 0; i < 2; i++) {
        if (!check_h(c,i)) {
          System.out.println("No");
          return;
        }
      }
      
      for (int j = 0; j < 2; j++) {
        if (!check_v(c,j)) {
          System.out.println("No");
          return;
        }
      }
      
      System.out.println("Yes");
    }
    finally {
      scanner.close();
    }
  }

  private static boolean check_v(int[][] c, int j) {
    for (int i = 0; i < 2; i++) {
      if (c[i][j+1] - c[i][j] != c[i+1][j+1] - c[i+1][j]) return false;
    }
    return true;
  }

  private static boolean check_h(int[][] c, int i) {
    for (int j = 0; j < 2; j++) {
      if (c[i+1][j] - c[i][j] != c[i+1][j+1] - c[i][j+1]) return false;
    }
    return true;
  }
} Main
import java.util.Scanner;

public class Main {
  public static void main(String[] args) throws Exception {
    Scanner scanner = new Scanner(System.in);
    try {
      int[][] c = new int[3][3];
      for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
          c[i][j] = scanner.nextInt();
        }
      }
      
      for (int i = 0; i < 2; i++) {
        if (!check_h(c,i)) {
          System.out.println("No");
          return;
        }
      }
      
      for (int j = 0; j < 2; j++) {
        if (!check_v(c,j)) {
          System.out.println("No");
          return;
        }
      }
      
      System.out.println("Yes");
    }
    finally {
      scanner.close();
    }
  }

  private static boolean check_v(int[][] c, int j) {
    for (int i = 0; i < 2; i++) {
      if (c[i][j+1] - c[i][j] != c[i+1][j+1] - c[i+1][j]) return false;
    }
    return true;
  }

  private static boolean check_h(int[][] c, int i) {
    for (int j = 0; j < 2; j++) {
      if (c[i+1][j] - c[i][j] != c[i+1][j+1] - c[i][j+1]) return false;
    }
    return true;
  }
}