import java.util.*;
import java.math.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a1 = Integer.parseInt(sc.next());
    int a2 = Integer.parseInt(sc.next());
    int a3 = Integer.parseInt(sc.next());
    int b1 = Integer.parseInt(sc.next());
    int b2 = Integer.parseInt(sc.next());
    int b3 = Integer.parseInt(sc.next());
    int c1 = Integer.parseInt(sc.next());
    int c2 = Integer.parseInt(sc.next());
    int c3 = Integer.parseInt(sc.next());
    
    boolean flg = true;
    if(
        a1-a2 != b1-b2 || a1-a3 != b1-b3 ||
        a1-a2 != c1-c2 || a1-a3 != c1-c3 || 

        a1-b1 != a2-b2 || a1-b1 != a3-b3 || 
        a1-c1 != a2-c2 || a1-c1 != a3-c3
    ){
        System.out.println("No");
    }else{
        System.out.println("Yes");
    }
  }
} import java.util.*; util.* java import java.math.*; math.* java public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a1 = Integer.parseInt(sc.next());
    int a2 = Integer.parseInt(sc.next());
    int a3 = Integer.parseInt(sc.next());
    int b1 = Integer.parseInt(sc.next());
    int b2 = Integer.parseInt(sc.next());
    int b3 = Integer.parseInt(sc.next());
    int c1 = Integer.parseInt(sc.next());
    int c2 = Integer.parseInt(sc.next());
    int c3 = Integer.parseInt(sc.next());
    
    boolean flg = true;
    if(
        a1-a2 != b1-b2 || a1-a3 != b1-b3 ||
        a1-a2 != c1-c2 || a1-a3 != c1-c3 || 

        a1-b1 != a2-b2 || a1-b1 != a3-b3 || 
        a1-c1 != a2-c2 || a1-c1 != a3-c3
    ){
        System.out.println("No");
    }else{
        System.out.println("Yes");
    }
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a1 = Integer.parseInt(sc.next());
    int a2 = Integer.parseInt(sc.next());
    int a3 = Integer.parseInt(sc.next());
    int b1 = Integer.parseInt(sc.next());
    int b2 = Integer.parseInt(sc.next());
    int b3 = Integer.parseInt(sc.next());
    int c1 = Integer.parseInt(sc.next());
    int c2 = Integer.parseInt(sc.next());
    int c3 = Integer.parseInt(sc.next());
    
    boolean flg = true;
    if(
        a1-a2 != b1-b2 || a1-a3 != b1-b3 ||
        a1-a2 != c1-c2 || a1-a3 != c1-c3 || 

        a1-b1 != a2-b2 || a1-b1 != a3-b3 || 
        a1-c1 != a2-c2 || a1-c1 != a3-c3
    ){
        System.out.println("No");
    }else{
        System.out.println("Yes");
    }
  } main {
    Scanner sc = new Scanner(System.in);
    int a1 = Integer.parseInt(sc.next());
    int a2 = Integer.parseInt(sc.next());
    int a3 = Integer.parseInt(sc.next());
    int b1 = Integer.parseInt(sc.next());
    int b2 = Integer.parseInt(sc.next());
    int b3 = Integer.parseInt(sc.next());
    int c1 = Integer.parseInt(sc.next());
    int c2 = Integer.parseInt(sc.next());
    int c3 = Integer.parseInt(sc.next());
    
    boolean flg = true;
    if(
        a1-a2 != b1-b2 || a1-a3 != b1-b3 ||
        a1-a2 != c1-c2 || a1-a3 != c1-c3 || 

        a1-b1 != a2-b2 || a1-b1 != a3-b3 || 
        a1-c1 != a2-c2 || a1-c1 != a3-c3
    ){
        System.out.println("No");
    }else{
        System.out.println("Yes");
    }
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a1 = Integer.parseInt(sc.next()); a1 Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int a2 = Integer.parseInt(sc.next()); a2 Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int a3 = Integer.parseInt(sc.next()); a3 Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int b1 = Integer.parseInt(sc.next()); b1 Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int b2 = Integer.parseInt(sc.next()); b2 Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int b3 = Integer.parseInt(sc.next()); b3 Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int c1 = Integer.parseInt(sc.next()); c1 Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int c2 = Integer.parseInt(sc.next()); c2 Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int c3 = Integer.parseInt(sc.next()); c3 Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc boolean flg = true; flg true if(
        a1-a2 != b1-b2 || a1-a3 != b1-b3 ||
        a1-a2 != c1-c2 || a1-a3 != c1-c3 || 

        a1-b1 != a2-b2 || a1-b1 != a3-b3 || 
        a1-c1 != a2-c2 || a1-c1 != a3-c3
    ){
        System.out.println("No");
    }else{
        System.out.println("Yes");
    } a1-a2 != b1-b2 || a1-a3 != b1-b3 ||
        a1-a2 != c1-c2 || a1-a3 != c1-c3 || 

        a1-b1 != a2-b2 || a1-b1 != a3-b3 || 
        a1-c1 != a2-c2 || a1-c1 != a3-c3 a1-c1 != a2-c2 a1-b1 != a3-b3 a1-b1 != a2-b2 a1-a3 != c1-c3 a1-a2 != c1-c2 a1-a2 != b1-b2 || a1-a3 != b1-b3 ||
        a1-a2 != c1-c2 || a1-a3 != c1-c3 || 

        a1-b1 != a2-b2 || a1-b1 != a3-b3 || 
        a1-c1 != a2-c2 || a1-c1 != a3-c3 a1-a2 != b1-b2 a1-a2 a1 a2 b1-b2 b1 b2 a1-a3 != b1-b3 a1-a3 a1 a3 b1-b3 b1 b3 a1-a2 != c1-c2 a1-a2 a1 a2 c1-c2 c1 c2 a1-a3 != c1-c3 a1-a3 a1 a3 c1-c3 c1 c3 a1-b1 != a2-b2 a1-b1 a1 b1 a2-b2 a2 b2 a1-b1 != a3-b3 a1-b1 a1 b1 a3-b3 a3 b3 a1-c1 != a2-c2 a1-c1 a1 c1 a2-c2 a2 c2 a1-c1 != a3-c3 a1-c1 a1 c1 a3-c3 a3 c3 {
        System.out.println("No");
    } System.out.println("No") System.out.println System.out System System.out "No" {
        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 sc = new Scanner(System.in);
    int a1 = Integer.parseInt(sc.next());
    int a2 = Integer.parseInt(sc.next());
    int a3 = Integer.parseInt(sc.next());
    int b1 = Integer.parseInt(sc.next());
    int b2 = Integer.parseInt(sc.next());
    int b3 = Integer.parseInt(sc.next());
    int c1 = Integer.parseInt(sc.next());
    int c2 = Integer.parseInt(sc.next());
    int c3 = Integer.parseInt(sc.next());
    
    boolean flg = true;
    if(
        a1-a2 != b1-b2 || a1-a3 != b1-b3 ||
        a1-a2 != c1-c2 || a1-a3 != c1-c3 || 

        a1-b1 != a2-b2 || a1-b1 != a3-b3 || 
        a1-c1 != a2-c2 || a1-c1 != a3-c3
    ){
        System.out.println("No");
    }else{
        System.out.println("Yes");
    }
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a1 = Integer.parseInt(sc.next());
    int a2 = Integer.parseInt(sc.next());
    int a3 = Integer.parseInt(sc.next());
    int b1 = Integer.parseInt(sc.next());
    int b2 = Integer.parseInt(sc.next());
    int b3 = Integer.parseInt(sc.next());
    int c1 = Integer.parseInt(sc.next());
    int c2 = Integer.parseInt(sc.next());
    int c3 = Integer.parseInt(sc.next());
    
    boolean flg = true;
    if(
        a1-a2 != b1-b2 || a1-a3 != b1-b3 ||
        a1-a2 != c1-c2 || a1-a3 != c1-c3 || 

        a1-b1 != a2-b2 || a1-b1 != a3-b3 || 
        a1-c1 != a2-c2 || a1-c1 != a3-c3
    ){
        System.out.println("No");
    }else{
        System.out.println("Yes");
    }
  }
} Main
import java.util.*;
import java.math.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a1 = Integer.parseInt(sc.next());
    int a2 = Integer.parseInt(sc.next());
    int a3 = Integer.parseInt(sc.next());
    int b1 = Integer.parseInt(sc.next());
    int b2 = Integer.parseInt(sc.next());
    int b3 = Integer.parseInt(sc.next());
    int c1 = Integer.parseInt(sc.next());
    int c2 = Integer.parseInt(sc.next());
    int c3 = Integer.parseInt(sc.next());
    
    boolean flg = true;
    if(
        a1-a2 != b1-b2 || a1-a3 != b1-b3 ||
        a1-a2 != c1-c2 || a1-a3 != c1-c3 || 

        a1-b1 != a2-b2 || a1-b1 != a3-b3 || 
        a1-c1 != a2-c2 || a1-c1 != a3-c3
    ){
        System.out.println("No");
    }else{
        System.out.println("Yes");
    }
  }
}
