import java.util.*;
import java.io.*;
import java.math.*;
import java.awt.geom.*;
 class Main{
    public static void main(String[] args) {
        MyScanner sc=new MyScanner();
        int c[][]=new int[4][4];
        for(int i=1;i<=3;i++)
            for(int j=1;j<=3;j++){
                c[i][j]=sc.ni();
            }
        boolean f=true;
        HashSet<Integer> hs=new HashSet<>();
        hs.add(c[1][1]-c[2][1]);hs.add(c[1][2]-c[2][2]);hs.add(c[1][3]-c[2][3]);
        if(hs.size()>1) f=false;
        hs.clear();

        hs.add(c[2][1]-c[3][1]);hs.add(c[2][2]-c[3][2]);hs.add(c[2][3]-c[3][3]);
        if(hs.size()>1) f=false;
        hs.clear();
        
        hs.add(c[1][1]-c[3][1]);hs.add(c[1][2]-c[3][2]);hs.add(c[1][3]-c[3][3]);
        if(hs.size()>1) f=false;
        hs.clear();

        hs.add(c[1][1]-c[1][2]);hs.add(c[2][1]-c[2][2]);hs.add(c[3][1]-c[3][2]);
        if(hs.size()>1) f=false;
        hs.clear();

        hs.add(c[1][2]-c[1][3]);hs.add(c[2][2]-c[2][3]);hs.add(c[3][2]-c[3][3]);
        if(hs.size()>1) f=false;
        hs.clear();

        hs.add(c[1][1]-c[1][3]);hs.add(c[2][1]-c[2][3]);hs.add(c[3][1]-c[3][3]);
        if(hs.size()>1) f=false;
        hs.clear();

        if(!f) System.out.println("No");
        else System.out.println("Yes");
    }


    private static class MyScanner {
      BufferedReader br;
      StringTokenizer st;

      public MyScanner() {
         br = new BufferedReader(new InputStreamReader(System.in));
      }

      String next() {
          while (st == null || !st.hasMoreElements()) {
              try {
                  st = new StringTokenizer(br.readLine());
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }
          return st.nextToken();
      }

      int ni() {
          return Integer.parseInt(next());
      }
      float nf() {
        return Float.parseFloat(next());
    }
      long nl() {
          return Long.parseLong(next());
      }

      double nd() {
          return Double.parseDouble(next());
      }

      String nextLine(){
          String str = "";
	  try {
	     str = br.readLine();
	  } catch (IOException e) {
	     e.printStackTrace();
	  }
	  return str;
      }
   }
} import java.util.*; util.* java import java.io.*; io.* java import java.math.*; math.* java import java.awt.geom.*; geom.* java.awt class Main{
    public static void main(String[] args) {
        MyScanner sc=new MyScanner();
        int c[][]=new int[4][4];
        for(int i=1;i<=3;i++)
            for(int j=1;j<=3;j++){
                c[i][j]=sc.ni();
            }
        boolean f=true;
        HashSet<Integer> hs=new HashSet<>();
        hs.add(c[1][1]-c[2][1]);hs.add(c[1][2]-c[2][2]);hs.add(c[1][3]-c[2][3]);
        if(hs.size()>1) f=false;
        hs.clear();

        hs.add(c[2][1]-c[3][1]);hs.add(c[2][2]-c[3][2]);hs.add(c[2][3]-c[3][3]);
        if(hs.size()>1) f=false;
        hs.clear();
        
        hs.add(c[1][1]-c[3][1]);hs.add(c[1][2]-c[3][2]);hs.add(c[1][3]-c[3][3]);
        if(hs.size()>1) f=false;
        hs.clear();

        hs.add(c[1][1]-c[1][2]);hs.add(c[2][1]-c[2][2]);hs.add(c[3][1]-c[3][2]);
        if(hs.size()>1) f=false;
        hs.clear();

        hs.add(c[1][2]-c[1][3]);hs.add(c[2][2]-c[2][3]);hs.add(c[3][2]-c[3][3]);
        if(hs.size()>1) f=false;
        hs.clear();

        hs.add(c[1][1]-c[1][3]);hs.add(c[2][1]-c[2][3]);hs.add(c[3][1]-c[3][3]);
        if(hs.size()>1) f=false;
        hs.clear();

        if(!f) System.out.println("No");
        else System.out.println("Yes");
    }


    private static class MyScanner {
      BufferedReader br;
      StringTokenizer st;

      public MyScanner() {
         br = new BufferedReader(new InputStreamReader(System.in));
      }

      String next() {
          while (st == null || !st.hasMoreElements()) {
              try {
                  st = new StringTokenizer(br.readLine());
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }
          return st.nextToken();
      }

      int ni() {
          return Integer.parseInt(next());
      }
      float nf() {
        return Float.parseFloat(next());
    }
      long nl() {
          return Long.parseLong(next());
      }

      double nd() {
          return Double.parseDouble(next());
      }

      String nextLine(){
          String str = "";
	  try {
	     str = br.readLine();
	  } catch (IOException e) {
	     e.printStackTrace();
	  }
	  return str;
      }
   }
} Main public static void main(String[] args) {
        MyScanner sc=new MyScanner();
        int c[][]=new int[4][4];
        for(int i=1;i<=3;i++)
            for(int j=1;j<=3;j++){
                c[i][j]=sc.ni();
            }
        boolean f=true;
        HashSet<Integer> hs=new HashSet<>();
        hs.add(c[1][1]-c[2][1]);hs.add(c[1][2]-c[2][2]);hs.add(c[1][3]-c[2][3]);
        if(hs.size()>1) f=false;
        hs.clear();

        hs.add(c[2][1]-c[3][1]);hs.add(c[2][2]-c[3][2]);hs.add(c[2][3]-c[3][3]);
        if(hs.size()>1) f=false;
        hs.clear();
        
        hs.add(c[1][1]-c[3][1]);hs.add(c[1][2]-c[3][2]);hs.add(c[1][3]-c[3][3]);
        if(hs.size()>1) f=false;
        hs.clear();

        hs.add(c[1][1]-c[1][2]);hs.add(c[2][1]-c[2][2]);hs.add(c[3][1]-c[3][2]);
        if(hs.size()>1) f=false;
        hs.clear();

        hs.add(c[1][2]-c[1][3]);hs.add(c[2][2]-c[2][3]);hs.add(c[3][2]-c[3][3]);
        if(hs.size()>1) f=false;
        hs.clear();

        hs.add(c[1][1]-c[1][3]);hs.add(c[2][1]-c[2][3]);hs.add(c[3][1]-c[3][3]);
        if(hs.size()>1) f=false;
        hs.clear();

        if(!f) System.out.println("No");
        else System.out.println("Yes");
    } main {
        MyScanner sc=new MyScanner();
        int c[][]=new int[4][4];
        for(int i=1;i<=3;i++)
            for(int j=1;j<=3;j++){
                c[i][j]=sc.ni();
            }
        boolean f=true;
        HashSet<Integer> hs=new HashSet<>();
        hs.add(c[1][1]-c[2][1]);hs.add(c[1][2]-c[2][2]);hs.add(c[1][3]-c[2][3]);
        if(hs.size()>1) f=false;
        hs.clear();

        hs.add(c[2][1]-c[3][1]);hs.add(c[2][2]-c[3][2]);hs.add(c[2][3]-c[3][3]);
        if(hs.size()>1) f=false;
        hs.clear();
        
        hs.add(c[1][1]-c[3][1]);hs.add(c[1][2]-c[3][2]);hs.add(c[1][3]-c[3][3]);
        if(hs.size()>1) f=false;
        hs.clear();

        hs.add(c[1][1]-c[1][2]);hs.add(c[2][1]-c[2][2]);hs.add(c[3][1]-c[3][2]);
        if(hs.size()>1) f=false;
        hs.clear();

        hs.add(c[1][2]-c[1][3]);hs.add(c[2][2]-c[2][3]);hs.add(c[3][2]-c[3][3]);
        if(hs.size()>1) f=false;
        hs.clear();

        hs.add(c[1][1]-c[1][3]);hs.add(c[2][1]-c[2][3]);hs.add(c[3][1]-c[3][3]);
        if(hs.size()>1) f=false;
        hs.clear();

        if(!f) System.out.println("No");
        else System.out.println("Yes");
    } MyScanner sc=new MyScanner(); sc new MyScanner() int c[][]=new int[4][4]; c new int[4][4] 4 4 for(int i=1;i<=3;i++)
            for(int j=1;j<=3;j++){
                c[i][j]=sc.ni();
            } int i=1; int i=1; i 1 i<=3 i 3 i++ i++ i for(int j=1;j<=3;j++){
                c[i][j]=sc.ni();
            } for(int j=1;j<=3;j++){
                c[i][j]=sc.ni();
            } int j=1; int j=1; j 1 j<=3 j 3 j++ j++ j {
                c[i][j]=sc.ni();
            } {
                c[i][j]=sc.ni();
            } c[i][j]=sc.ni() c[i][j] c[i] c i j sc.ni() sc.ni sc boolean f=true; f true HashSet<Integer> hs=new HashSet<>(); hs new HashSet<>() hs.add(c[1][1]-c[2][1]) hs.add hs c[1][1]-c[2][1] c[1][1] c[1] c 1 1 c[2][1] c[2] c 2 1 hs.add(c[1][2]-c[2][2]) hs.add hs c[1][2]-c[2][2] c[1][2] c[1] c 1 2 c[2][2] c[2] c 2 2 hs.add(c[1][3]-c[2][3]) hs.add hs c[1][3]-c[2][3] c[1][3] c[1] c 1 3 c[2][3] c[2] c 2 3 if(hs.size()>1) f=false; hs.size()>1 hs.size() hs.size hs 1 f=false f false hs.clear() hs.clear hs hs.add(c[2][1]-c[3][1]) hs.add hs c[2][1]-c[3][1] c[2][1] c[2] c 2 1 c[3][1] c[3] c 3 1 hs.add(c[2][2]-c[3][2]) hs.add hs c[2][2]-c[3][2] c[2][2] c[2] c 2 2 c[3][2] c[3] c 3 2 hs.add(c[2][3]-c[3][3]) hs.add hs c[2][3]-c[3][3] c[2][3] c[2] c 2 3 c[3][3] c[3] c 3 3 if(hs.size()>1) f=false; hs.size()>1 hs.size() hs.size hs 1 f=false f false hs.clear() hs.clear hs hs.add(c[1][1]-c[3][1]) hs.add hs c[1][1]-c[3][1] c[1][1] c[1] c 1 1 c[3][1] c[3] c 3 1 hs.add(c[1][2]-c[3][2]) hs.add hs c[1][2]-c[3][2] c[1][2] c[1] c 1 2 c[3][2] c[3] c 3 2 hs.add(c[1][3]-c[3][3]) hs.add hs c[1][3]-c[3][3] c[1][3] c[1] c 1 3 c[3][3] c[3] c 3 3 if(hs.size()>1) f=false; hs.size()>1 hs.size() hs.size hs 1 f=false f false hs.clear() hs.clear hs hs.add(c[1][1]-c[1][2]) hs.add hs c[1][1]-c[1][2] c[1][1] c[1] c 1 1 c[1][2] c[1] c 1 2 hs.add(c[2][1]-c[2][2]) hs.add hs c[2][1]-c[2][2] c[2][1] c[2] c 2 1 c[2][2] c[2] c 2 2 hs.add(c[3][1]-c[3][2]) hs.add hs c[3][1]-c[3][2] c[3][1] c[3] c 3 1 c[3][2] c[3] c 3 2 if(hs.size()>1) f=false; hs.size()>1 hs.size() hs.size hs 1 f=false f false hs.clear() hs.clear hs hs.add(c[1][2]-c[1][3]) hs.add hs c[1][2]-c[1][3] c[1][2] c[1] c 1 2 c[1][3] c[1] c 1 3 hs.add(c[2][2]-c[2][3]) hs.add hs c[2][2]-c[2][3] c[2][2] c[2] c 2 2 c[2][3] c[2] c 2 3 hs.add(c[3][2]-c[3][3]) hs.add hs c[3][2]-c[3][3] c[3][2] c[3] c 3 2 c[3][3] c[3] c 3 3 if(hs.size()>1) f=false; hs.size()>1 hs.size() hs.size hs 1 f=false f false hs.clear() hs.clear hs hs.add(c[1][1]-c[1][3]) hs.add hs c[1][1]-c[1][3] c[1][1] c[1] c 1 1 c[1][3] c[1] c 1 3 hs.add(c[2][1]-c[2][3]) hs.add hs c[2][1]-c[2][3] c[2][1] c[2] c 2 1 c[2][3] c[2] c 2 3 hs.add(c[3][1]-c[3][3]) hs.add hs c[3][1]-c[3][3] c[3][1] c[3] c 3 1 c[3][3] c[3] c 3 3 if(hs.size()>1) f=false; hs.size()>1 hs.size() hs.size hs 1 f=false f false hs.clear() hs.clear hs if(!f) System.out.println("No");
        else System.out.println("Yes"); !f f System.out.println("No") System.out.println System.out System System.out "No" System.out.println("Yes") System.out.println System.out System System.out "Yes" String[] args args private static class MyScanner {
      BufferedReader br;
      StringTokenizer st;

      public MyScanner() {
         br = new BufferedReader(new InputStreamReader(System.in));
      }

      String next() {
          while (st == null || !st.hasMoreElements()) {
              try {
                  st = new StringTokenizer(br.readLine());
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }
          return st.nextToken();
      }

      int ni() {
          return Integer.parseInt(next());
      }
      float nf() {
        return Float.parseFloat(next());
    }
      long nl() {
          return Long.parseLong(next());
      }

      double nd() {
          return Double.parseDouble(next());
      }

      String nextLine(){
          String str = "";
	  try {
	     str = br.readLine();
	  } catch (IOException e) {
	     e.printStackTrace();
	  }
	  return str;
      }
   } MyScanner BufferedReader br; br StringTokenizer st; st public MyScanner() {
         br = new BufferedReader(new InputStreamReader(System.in));
      } MyScanner {
         br = new BufferedReader(new InputStreamReader(System.in));
      } br = new BufferedReader(new InputStreamReader(System.in)) br new BufferedReader(new InputStreamReader(System.in)) String next() {
          while (st == null || !st.hasMoreElements()) {
              try {
                  st = new StringTokenizer(br.readLine());
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }
          return st.nextToken();
      } next {
          while (st == null || !st.hasMoreElements()) {
              try {
                  st = new StringTokenizer(br.readLine());
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }
          return st.nextToken();
      } while (st == null || !st.hasMoreElements()) {
              try {
                  st = new StringTokenizer(br.readLine());
              } catch (IOException e) {
                  e.printStackTrace();
              }
          } st == null || !st.hasMoreElements() st == null st null !st.hasMoreElements() st.hasMoreElements() st.hasMoreElements st {
              try {
                  st = new StringTokenizer(br.readLine());
              } catch (IOException e) {
                  e.printStackTrace();
              }
          } try {
                  st = new StringTokenizer(br.readLine());
              } catch (IOException e) {
                  e.printStackTrace();
              } catch (IOException e) {
                  e.printStackTrace();
              } IOException e {
                  e.printStackTrace();
              } e.printStackTrace() e.printStackTrace e {
                  st = new StringTokenizer(br.readLine());
              } st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return st.nextToken(); st.nextToken() st.nextToken st int ni() {
          return Integer.parseInt(next());
      } ni {
          return Integer.parseInt(next());
      } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next float nf() {
        return Float.parseFloat(next());
    } nf {
        return Float.parseFloat(next());
    } return Float.parseFloat(next()); Float.parseFloat(next()) Float.parseFloat Float next() next long nl() {
          return Long.parseLong(next());
      } nl {
          return Long.parseLong(next());
      } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next double nd() {
          return Double.parseDouble(next());
      } nd {
          return Double.parseDouble(next());
      } return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next String nextLine(){
          String str = "";
	  try {
	     str = br.readLine();
	  } catch (IOException e) {
	     e.printStackTrace();
	  }
	  return str;
      } nextLine {
          String str = "";
	  try {
	     str = br.readLine();
	  } catch (IOException e) {
	     e.printStackTrace();
	  }
	  return str;
      } String str = ""; str "" try {
	     str = br.readLine();
	  } catch (IOException e) {
	     e.printStackTrace();
	  } catch (IOException e) {
	     e.printStackTrace();
	  } IOException e {
	     e.printStackTrace();
	  } e.printStackTrace() e.printStackTrace e {
	     str = br.readLine();
	  } str = br.readLine() str br.readLine() br.readLine br return str; str
import java.util.*;
import java.io.*;
import java.math.*;
import java.awt.geom.*;
 class Main{
    public static void main(String[] args) {
        MyScanner sc=new MyScanner();
        int c[][]=new int[4][4];
        for(int i=1;i<=3;i++)
            for(int j=1;j<=3;j++){
                c[i][j]=sc.ni();
            }
        boolean f=true;
        HashSet<Integer> hs=new HashSet<>();
        hs.add(c[1][1]-c[2][1]);hs.add(c[1][2]-c[2][2]);hs.add(c[1][3]-c[2][3]);
        if(hs.size()>1) f=false;
        hs.clear();

        hs.add(c[2][1]-c[3][1]);hs.add(c[2][2]-c[3][2]);hs.add(c[2][3]-c[3][3]);
        if(hs.size()>1) f=false;
        hs.clear();
        
        hs.add(c[1][1]-c[3][1]);hs.add(c[1][2]-c[3][2]);hs.add(c[1][3]-c[3][3]);
        if(hs.size()>1) f=false;
        hs.clear();

        hs.add(c[1][1]-c[1][2]);hs.add(c[2][1]-c[2][2]);hs.add(c[3][1]-c[3][2]);
        if(hs.size()>1) f=false;
        hs.clear();

        hs.add(c[1][2]-c[1][3]);hs.add(c[2][2]-c[2][3]);hs.add(c[3][2]-c[3][3]);
        if(hs.size()>1) f=false;
        hs.clear();

        hs.add(c[1][1]-c[1][3]);hs.add(c[2][1]-c[2][3]);hs.add(c[3][1]-c[3][3]);
        if(hs.size()>1) f=false;
        hs.clear();

        if(!f) System.out.println("No");
        else System.out.println("Yes");
    }


    private static class MyScanner {
      BufferedReader br;
      StringTokenizer st;

      public MyScanner() {
         br = new BufferedReader(new InputStreamReader(System.in));
      }

      String next() {
          while (st == null || !st.hasMoreElements()) {
              try {
                  st = new StringTokenizer(br.readLine());
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }
          return st.nextToken();
      }

      int ni() {
          return Integer.parseInt(next());
      }
      float nf() {
        return Float.parseFloat(next());
    }
      long nl() {
          return Long.parseLong(next());
      }

      double nd() {
          return Double.parseDouble(next());
      }

      String nextLine(){
          String str = "";
	  try {
	     str = br.readLine();
	  } catch (IOException e) {
	     e.printStackTrace();
	  }
	  return str;
      }
   }
}