import java.util.*;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);

    int[][] m = new int[3][3];
    String result = "";
    
    for(int i = 0 ; i < 3 ; ++i){
      for(int j = 0 ; j < 3 ; ++j){
        m[i][j] = sc.nextInt();
      }
    }
    //縦比較
    int a = m[0][0] - m[0][1];//1
    int b = m[0][0] - m[0][2];//2
    int c = m[1][0] - m[1][1];//1
    int d = m[1][0] - m[1][2];//2
    int e = m[2][0] - m[2][1];//1
    int f = m[2][0] - m[2][2];//2
    //横比較
    int g = m[0][0] - m[1][0];//1
    int h = m[0][0] - m[2][0];//2
    int i = m[0][1] - m[1][1];//1
    int j = m[0][1] - m[2][1];//2
    int k = m[0][2] - m[1][2];//1
    int l = m[0][2] - m[2][2];//2
    
    //比較する
    boolean ac = a==c;
    boolean ae = a==e;
    boolean ce = c==e;
    boolean ace = ac&&ae&&ce;
    boolean bd = b==d;
    boolean bf = b==f;
    boolean df = d==f;
    boolean bdf = bd&&bf&&df;
    boolean gi = g==i;
    boolean gk = g==k;
    boolean ik = i==k;
    boolean gik = gi&&gk&&ik;
    boolean hj = h==j;
    boolean hl = h==l;
    boolean jl = j==l;
    boolean hjl = hj&&hl&&jl;
    
    if(ace && bdf && gik && hjl){
      result = "Yes";
    }else{
      result = "No";
    }

    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[][] m = new int[3][3];
    String result = "";
    
    for(int i = 0 ; i < 3 ; ++i){
      for(int j = 0 ; j < 3 ; ++j){
        m[i][j] = sc.nextInt();
      }
    }
    //縦比較
    int a = m[0][0] - m[0][1];//1
    int b = m[0][0] - m[0][2];//2
    int c = m[1][0] - m[1][1];//1
    int d = m[1][0] - m[1][2];//2
    int e = m[2][0] - m[2][1];//1
    int f = m[2][0] - m[2][2];//2
    //横比較
    int g = m[0][0] - m[1][0];//1
    int h = m[0][0] - m[2][0];//2
    int i = m[0][1] - m[1][1];//1
    int j = m[0][1] - m[2][1];//2
    int k = m[0][2] - m[1][2];//1
    int l = m[0][2] - m[2][2];//2
    
    //比較する
    boolean ac = a==c;
    boolean ae = a==e;
    boolean ce = c==e;
    boolean ace = ac&&ae&&ce;
    boolean bd = b==d;
    boolean bf = b==f;
    boolean df = d==f;
    boolean bdf = bd&&bf&&df;
    boolean gi = g==i;
    boolean gk = g==k;
    boolean ik = i==k;
    boolean gik = gi&&gk&&ik;
    boolean hj = h==j;
    boolean hl = h==l;
    boolean jl = j==l;
    boolean hjl = hj&&hl&&jl;
    
    if(ace && bdf && gik && hjl){
      result = "Yes";
    }else{
      result = "No";
    }

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

    int[][] m = new int[3][3];
    String result = "";
    
    for(int i = 0 ; i < 3 ; ++i){
      for(int j = 0 ; j < 3 ; ++j){
        m[i][j] = sc.nextInt();
      }
    }
    //縦比較
    int a = m[0][0] - m[0][1];//1
    int b = m[0][0] - m[0][2];//2
    int c = m[1][0] - m[1][1];//1
    int d = m[1][0] - m[1][2];//2
    int e = m[2][0] - m[2][1];//1
    int f = m[2][0] - m[2][2];//2
    //横比較
    int g = m[0][0] - m[1][0];//1
    int h = m[0][0] - m[2][0];//2
    int i = m[0][1] - m[1][1];//1
    int j = m[0][1] - m[2][1];//2
    int k = m[0][2] - m[1][2];//1
    int l = m[0][2] - m[2][2];//2
    
    //比較する
    boolean ac = a==c;
    boolean ae = a==e;
    boolean ce = c==e;
    boolean ace = ac&&ae&&ce;
    boolean bd = b==d;
    boolean bf = b==f;
    boolean df = d==f;
    boolean bdf = bd&&bf&&df;
    boolean gi = g==i;
    boolean gk = g==k;
    boolean ik = i==k;
    boolean gik = gi&&gk&&ik;
    boolean hj = h==j;
    boolean hl = h==l;
    boolean jl = j==l;
    boolean hjl = hj&&hl&&jl;
    
    if(ace && bdf && gik && hjl){
      result = "Yes";
    }else{
      result = "No";
    }

    System.out.println(result);
    
  } main {
    Scanner sc = new Scanner(System.in);

    int[][] m = new int[3][3];
    String result = "";
    
    for(int i = 0 ; i < 3 ; ++i){
      for(int j = 0 ; j < 3 ; ++j){
        m[i][j] = sc.nextInt();
      }
    }
    //縦比較
    int a = m[0][0] - m[0][1];//1
    int b = m[0][0] - m[0][2];//2
    int c = m[1][0] - m[1][1];//1
    int d = m[1][0] - m[1][2];//2
    int e = m[2][0] - m[2][1];//1
    int f = m[2][0] - m[2][2];//2
    //横比較
    int g = m[0][0] - m[1][0];//1
    int h = m[0][0] - m[2][0];//2
    int i = m[0][1] - m[1][1];//1
    int j = m[0][1] - m[2][1];//2
    int k = m[0][2] - m[1][2];//1
    int l = m[0][2] - m[2][2];//2
    
    //比較する
    boolean ac = a==c;
    boolean ae = a==e;
    boolean ce = c==e;
    boolean ace = ac&&ae&&ce;
    boolean bd = b==d;
    boolean bf = b==f;
    boolean df = d==f;
    boolean bdf = bd&&bf&&df;
    boolean gi = g==i;
    boolean gk = g==k;
    boolean ik = i==k;
    boolean gik = gi&&gk&&ik;
    boolean hj = h==j;
    boolean hl = h==l;
    boolean jl = j==l;
    boolean hjl = hj&&hl&&jl;
    
    if(ace && bdf && gik && hjl){
      result = "Yes";
    }else{
      result = "No";
    }

    System.out.println(result);
    
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[][] m = new int[3][3]; m new int[3][3] 3 3 String result = ""; result "" for(int i = 0 ; i < 3 ; ++i){
      for(int j = 0 ; j < 3 ; ++j){
        m[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){
        m[i][j] = sc.nextInt();
      }
    } {
      for(int j = 0 ; j < 3 ; ++j){
        m[i][j] = sc.nextInt();
      }
    } for(int j = 0 ; j < 3 ; ++j){
        m[i][j] = sc.nextInt();
      } int j = 0 ; int j = 0 ; j 0 j < 3 j 3 ++j ++j j {
        m[i][j] = sc.nextInt();
      } {
        m[i][j] = sc.nextInt();
      } m[i][j] = sc.nextInt() m[i][j] m[i] m i j sc.nextInt() sc.nextInt sc int a = m[0][0] - m[0][1]; a m[0][0] - m[0][1] m[0][0] m[0] m 0 0 m[0][1] m[0] m 0 1 int b = m[0][0] - m[0][2]; b m[0][0] - m[0][2] m[0][0] m[0] m 0 0 m[0][2] m[0] m 0 2 int c = m[1][0] - m[1][1]; c m[1][0] - m[1][1] m[1][0] m[1] m 1 0 m[1][1] m[1] m 1 1 int d = m[1][0] - m[1][2]; d m[1][0] - m[1][2] m[1][0] m[1] m 1 0 m[1][2] m[1] m 1 2 int e = m[2][0] - m[2][1]; e m[2][0] - m[2][1] m[2][0] m[2] m 2 0 m[2][1] m[2] m 2 1 int f = m[2][0] - m[2][2]; f m[2][0] - m[2][2] m[2][0] m[2] m 2 0 m[2][2] m[2] m 2 2 int g = m[0][0] - m[1][0]; g m[0][0] - m[1][0] m[0][0] m[0] m 0 0 m[1][0] m[1] m 1 0 int h = m[0][0] - m[2][0]; h m[0][0] - m[2][0] m[0][0] m[0] m 0 0 m[2][0] m[2] m 2 0 int i = m[0][1] - m[1][1]; i m[0][1] - m[1][1] m[0][1] m[0] m 0 1 m[1][1] m[1] m 1 1 int j = m[0][1] - m[2][1]; j m[0][1] - m[2][1] m[0][1] m[0] m 0 1 m[2][1] m[2] m 2 1 int k = m[0][2] - m[1][2]; k m[0][2] - m[1][2] m[0][2] m[0] m 0 2 m[1][2] m[1] m 1 2 int l = m[0][2] - m[2][2]; l m[0][2] - m[2][2] m[0][2] m[0] m 0 2 m[2][2] m[2] m 2 2 boolean ac = a==c; ac a==c a c boolean ae = a==e; ae a==e a e boolean ce = c==e; ce c==e c e boolean ace = ac&&ae&&ce; ace ac&&ae&&ce ac&&ae&&ce ac ae ce boolean bd = b==d; bd b==d b d boolean bf = b==f; bf b==f b f boolean df = d==f; df d==f d f boolean bdf = bd&&bf&&df; bdf bd&&bf&&df bd&&bf&&df bd bf df boolean gi = g==i; gi g==i g i boolean gk = g==k; gk g==k g k boolean ik = i==k; ik i==k i k boolean gik = gi&&gk&&ik; gik gi&&gk&&ik gi&&gk&&ik gi gk ik boolean hj = h==j; hj h==j h j boolean hl = h==l; hl h==l h l boolean jl = j==l; jl j==l j l boolean hjl = hj&&hl&&jl; hjl hj&&hl&&jl hj&&hl&&jl hj hl jl if(ace && bdf && gik && hjl){
      result = "Yes";
    }else{
      result = "No";
    } ace && bdf && gik && hjl gik ace && bdf && gik && hjl ace bdf gik hjl {
      result = "Yes";
    } result = "Yes" result "Yes" {
      result = "No";
    } result = "No" result "No" 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[][] m = new int[3][3];
    String result = "";
    
    for(int i = 0 ; i < 3 ; ++i){
      for(int j = 0 ; j < 3 ; ++j){
        m[i][j] = sc.nextInt();
      }
    }
    //縦比較
    int a = m[0][0] - m[0][1];//1
    int b = m[0][0] - m[0][2];//2
    int c = m[1][0] - m[1][1];//1
    int d = m[1][0] - m[1][2];//2
    int e = m[2][0] - m[2][1];//1
    int f = m[2][0] - m[2][2];//2
    //横比較
    int g = m[0][0] - m[1][0];//1
    int h = m[0][0] - m[2][0];//2
    int i = m[0][1] - m[1][1];//1
    int j = m[0][1] - m[2][1];//2
    int k = m[0][2] - m[1][2];//1
    int l = m[0][2] - m[2][2];//2
    
    //比較する
    boolean ac = a==c;
    boolean ae = a==e;
    boolean ce = c==e;
    boolean ace = ac&&ae&&ce;
    boolean bd = b==d;
    boolean bf = b==f;
    boolean df = d==f;
    boolean bdf = bd&&bf&&df;
    boolean gi = g==i;
    boolean gk = g==k;
    boolean ik = i==k;
    boolean gik = gi&&gk&&ik;
    boolean hj = h==j;
    boolean hl = h==l;
    boolean jl = j==l;
    boolean hjl = hj&&hl&&jl;
    
    if(ace && bdf && gik && hjl){
      result = "Yes";
    }else{
      result = "No";
    }

    System.out.println(result);
    
  }
} public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);

    int[][] m = new int[3][3];
    String result = "";
    
    for(int i = 0 ; i < 3 ; ++i){
      for(int j = 0 ; j < 3 ; ++j){
        m[i][j] = sc.nextInt();
      }
    }
    //縦比較
    int a = m[0][0] - m[0][1];//1
    int b = m[0][0] - m[0][2];//2
    int c = m[1][0] - m[1][1];//1
    int d = m[1][0] - m[1][2];//2
    int e = m[2][0] - m[2][1];//1
    int f = m[2][0] - m[2][2];//2
    //横比較
    int g = m[0][0] - m[1][0];//1
    int h = m[0][0] - m[2][0];//2
    int i = m[0][1] - m[1][1];//1
    int j = m[0][1] - m[2][1];//2
    int k = m[0][2] - m[1][2];//1
    int l = m[0][2] - m[2][2];//2
    
    //比較する
    boolean ac = a==c;
    boolean ae = a==e;
    boolean ce = c==e;
    boolean ace = ac&&ae&&ce;
    boolean bd = b==d;
    boolean bf = b==f;
    boolean df = d==f;
    boolean bdf = bd&&bf&&df;
    boolean gi = g==i;
    boolean gk = g==k;
    boolean ik = i==k;
    boolean gik = gi&&gk&&ik;
    boolean hj = h==j;
    boolean hl = h==l;
    boolean jl = j==l;
    boolean hjl = hj&&hl&&jl;
    
    if(ace && bdf && gik && hjl){
      result = "Yes";
    }else{
      result = "No";
    }

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

    int[][] m = new int[3][3];
    String result = "";
    
    for(int i = 0 ; i < 3 ; ++i){
      for(int j = 0 ; j < 3 ; ++j){
        m[i][j] = sc.nextInt();
      }
    }
    //縦比較
    int a = m[0][0] - m[0][1];//1
    int b = m[0][0] - m[0][2];//2
    int c = m[1][0] - m[1][1];//1
    int d = m[1][0] - m[1][2];//2
    int e = m[2][0] - m[2][1];//1
    int f = m[2][0] - m[2][2];//2
    //横比較
    int g = m[0][0] - m[1][0];//1
    int h = m[0][0] - m[2][0];//2
    int i = m[0][1] - m[1][1];//1
    int j = m[0][1] - m[2][1];//2
    int k = m[0][2] - m[1][2];//1
    int l = m[0][2] - m[2][2];//2
    
    //比較する
    boolean ac = a==c;
    boolean ae = a==e;
    boolean ce = c==e;
    boolean ace = ac&&ae&&ce;
    boolean bd = b==d;
    boolean bf = b==f;
    boolean df = d==f;
    boolean bdf = bd&&bf&&df;
    boolean gi = g==i;
    boolean gk = g==k;
    boolean ik = i==k;
    boolean gik = gi&&gk&&ik;
    boolean hj = h==j;
    boolean hl = h==l;
    boolean jl = j==l;
    boolean hjl = hj&&hl&&jl;
    
    if(ace && bdf && gik && hjl){
      result = "Yes";
    }else{
      result = "No";
    }

    System.out.println(result);
    
  }
}

