import java.io.InputStreamReader;
import java.io.IOException;
import java.lang.reflect.Method;
import java.util.*;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import static java.lang.Math.*;

public class Main {

    public static void main(String[] args) {
        final String[] tasks = new String[]{"D","C","B","A"};
        for(final String task:tasks) {
            try {
                Class ca = Main.class.getClassLoader().loadClass(task);
                if (ca.getField("on").getInt(null) == 1) {
                    Object aTask = ca.newInstance();
                    Method m = ca.getMethod("S", null);
                    m.invoke(aTask, null);
                }
            } catch (Exception ex) { }
        }
    }

}

class A {
    public static int on = 1;

    public void run(){
        int[][] a = new int[3][3];
        for(int i=0;i<3;i++){
            for(int j=0;j<3;j++){
                a[i][j] = ni();
            }
        }

        for(int i=1;i<3;i++){
            int r = -100000;
            for(int j=0;j<3;j++){
                if(r==-100000) {
                    r = a[i][j] - a[i - 1][j];
                }else if(r!=(a[i][j] - a[i - 1][j])){
                    pl("No");
                    return;
                }
            }
        }


        for(int j=1;j<3;j++){
            int r = -100000;
            for(int i=0;i<3;i++){
                if(r==-100000) {
                    r = a[i][j] - a[i][j-1];
                }else if(r!=(a[i][j] - a[i][j-1])){
                    pl("No");
                    return;
                }
            }
        }
        pl("Yes");






    }
    private InputReader in =  new InputReader(System.in);
    private PrintWriter out = new PrintWriter(System.out);
    public void S(){run();out.close(); }
    public int ni(){return Integer.parseInt(in.ns());}
    public long nl(){return Long.parseLong(in.ns());}
    public String ns(){return in.ns();}
    public void p(Object obj){out.print(obj);}
    public void ps(Object obj){p(obj);p(" ");}
    public void pl(Object obj){out.println(obj);}
    public int gcd(int a,int b){ while( b != 0 ) { int t = a % b;a = b;b = t; } return a; }
}

class B {
    public static int on = 0;

    public void run(){

    }
}

class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream), 32768);
        tokenizer = null;
    }

    public String ns() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

}


 import java.io.InputStreamReader; InputStreamReader java.io import java.io.IOException; IOException java.io import java.lang.reflect.Method; Method java.lang.reflect import java.util.*; util.* java import java.io.BufferedReader; BufferedReader java.io import java.io.PrintWriter; PrintWriter java.io import java.io.InputStream; InputStream java.io import static java.lang.Math.*; import static java.lang.Math.*; import static java.lang.Math.*; public class Main {

    public static void main(String[] args) {
        final String[] tasks = new String[]{"D","C","B","A"};
        for(final String task:tasks) {
            try {
                Class ca = Main.class.getClassLoader().loadClass(task);
                if (ca.getField("on").getInt(null) == 1) {
                    Object aTask = ca.newInstance();
                    Method m = ca.getMethod("S", null);
                    m.invoke(aTask, null);
                }
            } catch (Exception ex) { }
        }
    }

} Main public static void main(String[] args) {
        final String[] tasks = new String[]{"D","C","B","A"};
        for(final String task:tasks) {
            try {
                Class ca = Main.class.getClassLoader().loadClass(task);
                if (ca.getField("on").getInt(null) == 1) {
                    Object aTask = ca.newInstance();
                    Method m = ca.getMethod("S", null);
                    m.invoke(aTask, null);
                }
            } catch (Exception ex) { }
        }
    } main {
        final String[] tasks = new String[]{"D","C","B","A"};
        for(final String task:tasks) {
            try {
                Class ca = Main.class.getClassLoader().loadClass(task);
                if (ca.getField("on").getInt(null) == 1) {
                    Object aTask = ca.newInstance();
                    Method m = ca.getMethod("S", null);
                    m.invoke(aTask, null);
                }
            } catch (Exception ex) { }
        }
    } final String[] tasks = new String[]{"D","C","B","A"}; tasks new String[]{"D","C","B","A"} for(final String task:tasks) {
            try {
                Class ca = Main.class.getClassLoader().loadClass(task);
                if (ca.getField("on").getInt(null) == 1) {
                    Object aTask = ca.newInstance();
                    Method m = ca.getMethod("S", null);
                    m.invoke(aTask, null);
                }
            } catch (Exception ex) { }
        } final String task tasks {
            try {
                Class ca = Main.class.getClassLoader().loadClass(task);
                if (ca.getField("on").getInt(null) == 1) {
                    Object aTask = ca.newInstance();
                    Method m = ca.getMethod("S", null);
                    m.invoke(aTask, null);
                }
            } catch (Exception ex) { }
        } {
            try {
                Class ca = Main.class.getClassLoader().loadClass(task);
                if (ca.getField("on").getInt(null) == 1) {
                    Object aTask = ca.newInstance();
                    Method m = ca.getMethod("S", null);
                    m.invoke(aTask, null);
                }
            } catch (Exception ex) { }
        } try {
                Class ca = Main.class.getClassLoader().loadClass(task);
                if (ca.getField("on").getInt(null) == 1) {
                    Object aTask = ca.newInstance();
                    Method m = ca.getMethod("S", null);
                    m.invoke(aTask, null);
                }
            } catch (Exception ex) { } catch (Exception ex) { } Exception ex { } {
                Class ca = Main.class.getClassLoader().loadClass(task);
                if (ca.getField("on").getInt(null) == 1) {
                    Object aTask = ca.newInstance();
                    Method m = ca.getMethod("S", null);
                    m.invoke(aTask, null);
                }
            } Class ca = Main.class.getClassLoader().loadClass(task); ca Main.class.getClassLoader().loadClass(task) Main.class.getClassLoader().loadClass Main.class.getClassLoader() Main.class.getClassLoader Main.class Main.class task if (ca.getField("on").getInt(null) == 1) {
                    Object aTask = ca.newInstance();
                    Method m = ca.getMethod("S", null);
                    m.invoke(aTask, null);
                } ca.getField("on").getInt(null) == 1 ca.getField("on").getInt(null) ca.getField("on").getInt ca.getField("on") ca.getField ca "on" null 1 {
                    Object aTask = ca.newInstance();
                    Method m = ca.getMethod("S", null);
                    m.invoke(aTask, null);
                } Object aTask = ca.newInstance(); aTask ca.newInstance() ca.newInstance ca Method m = ca.getMethod("S", null); m ca.getMethod("S", null) ca.getMethod ca "S" null m.invoke(aTask, null) m.invoke m aTask null String[] args args class A {
    public static int on = 1;

    public void run(){
        int[][] a = new int[3][3];
        for(int i=0;i<3;i++){
            for(int j=0;j<3;j++){
                a[i][j] = ni();
            }
        }

        for(int i=1;i<3;i++){
            int r = -100000;
            for(int j=0;j<3;j++){
                if(r==-100000) {
                    r = a[i][j] - a[i - 1][j];
                }else if(r!=(a[i][j] - a[i - 1][j])){
                    pl("No");
                    return;
                }
            }
        }


        for(int j=1;j<3;j++){
            int r = -100000;
            for(int i=0;i<3;i++){
                if(r==-100000) {
                    r = a[i][j] - a[i][j-1];
                }else if(r!=(a[i][j] - a[i][j-1])){
                    pl("No");
                    return;
                }
            }
        }
        pl("Yes");






    }
    private InputReader in =  new InputReader(System.in);
    private PrintWriter out = new PrintWriter(System.out);
    public void S(){run();out.close(); }
    public int ni(){return Integer.parseInt(in.ns());}
    public long nl(){return Long.parseLong(in.ns());}
    public String ns(){return in.ns();}
    public void p(Object obj){out.print(obj);}
    public void ps(Object obj){p(obj);p(" ");}
    public void pl(Object obj){out.println(obj);}
    public int gcd(int a,int b){ while( b != 0 ) { int t = a % b;a = b;b = t; } return a; }
} A public static int on = 1; on 1 private InputReader in =  new InputReader(System.in); in new InputReader(System.in) private PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) public void run(){
        int[][] a = new int[3][3];
        for(int i=0;i<3;i++){
            for(int j=0;j<3;j++){
                a[i][j] = ni();
            }
        }

        for(int i=1;i<3;i++){
            int r = -100000;
            for(int j=0;j<3;j++){
                if(r==-100000) {
                    r = a[i][j] - a[i - 1][j];
                }else if(r!=(a[i][j] - a[i - 1][j])){
                    pl("No");
                    return;
                }
            }
        }


        for(int j=1;j<3;j++){
            int r = -100000;
            for(int i=0;i<3;i++){
                if(r==-100000) {
                    r = a[i][j] - a[i][j-1];
                }else if(r!=(a[i][j] - a[i][j-1])){
                    pl("No");
                    return;
                }
            }
        }
        pl("Yes");






    } run {
        int[][] a = new int[3][3];
        for(int i=0;i<3;i++){
            for(int j=0;j<3;j++){
                a[i][j] = ni();
            }
        }

        for(int i=1;i<3;i++){
            int r = -100000;
            for(int j=0;j<3;j++){
                if(r==-100000) {
                    r = a[i][j] - a[i - 1][j];
                }else if(r!=(a[i][j] - a[i - 1][j])){
                    pl("No");
                    return;
                }
            }
        }


        for(int j=1;j<3;j++){
            int r = -100000;
            for(int i=0;i<3;i++){
                if(r==-100000) {
                    r = a[i][j] - a[i][j-1];
                }else if(r!=(a[i][j] - a[i][j-1])){
                    pl("No");
                    return;
                }
            }
        }
        pl("Yes");






    } int[][] a = new int[3][3]; a new int[3][3] 3 3 for(int i=0;i<3;i++){
            for(int j=0;j<3;j++){
                a[i][j] = ni();
            }
        } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
            for(int j=0;j<3;j++){
                a[i][j] = ni();
            }
        } {
            for(int j=0;j<3;j++){
                a[i][j] = ni();
            }
        } for(int j=0;j<3;j++){
                a[i][j] = ni();
            } int j=0; int j=0; j 0 j<3 j 3 j++ j++ j {
                a[i][j] = ni();
            } {
                a[i][j] = ni();
            } a[i][j] = ni() a[i][j] a[i] a i j ni() ni for(int i=1;i<3;i++){
            int r = -100000;
            for(int j=0;j<3;j++){
                if(r==-100000) {
                    r = a[i][j] - a[i - 1][j];
                }else if(r!=(a[i][j] - a[i - 1][j])){
                    pl("No");
                    return;
                }
            }
        } int i=1; int i=1; i 1 i<3 i 3 i++ i++ i {
            int r = -100000;
            for(int j=0;j<3;j++){
                if(r==-100000) {
                    r = a[i][j] - a[i - 1][j];
                }else if(r!=(a[i][j] - a[i - 1][j])){
                    pl("No");
                    return;
                }
            }
        } {
            int r = -100000;
            for(int j=0;j<3;j++){
                if(r==-100000) {
                    r = a[i][j] - a[i - 1][j];
                }else if(r!=(a[i][j] - a[i - 1][j])){
                    pl("No");
                    return;
                }
            }
        } int r = -100000; r -100000 100000 for(int j=0;j<3;j++){
                if(r==-100000) {
                    r = a[i][j] - a[i - 1][j];
                }else if(r!=(a[i][j] - a[i - 1][j])){
                    pl("No");
                    return;
                }
            } int j=0; int j=0; j 0 j<3 j 3 j++ j++ j {
                if(r==-100000) {
                    r = a[i][j] - a[i - 1][j];
                }else if(r!=(a[i][j] - a[i - 1][j])){
                    pl("No");
                    return;
                }
            } {
                if(r==-100000) {
                    r = a[i][j] - a[i - 1][j];
                }else if(r!=(a[i][j] - a[i - 1][j])){
                    pl("No");
                    return;
                }
            } if(r==-100000) {
                    r = a[i][j] - a[i - 1][j];
                }else if(r!=(a[i][j] - a[i - 1][j])){
                    pl("No");
                    return;
                } r==-100000 r -100000 100000 {
                    r = a[i][j] - a[i - 1][j];
                } r = a[i][j] - a[i - 1][j] r a[i][j] - a[i - 1][j] a[i][j] a[i] a i j a[i - 1][j] a[i - 1] a i - 1 i 1 j if(r!=(a[i][j] - a[i - 1][j])){
                    pl("No");
                    return;
                } r!=(a[i][j] - a[i - 1][j]) r (a[i][j] - a[i - 1][j]) a[i][j] a[i] a i j a[i - 1][j] a[i - 1] a i - 1 i 1 j {
                    pl("No");
                    return;
                } pl("No") pl "No" return; for(int j=1;j<3;j++){
            int r = -100000;
            for(int i=0;i<3;i++){
                if(r==-100000) {
                    r = a[i][j] - a[i][j-1];
                }else if(r!=(a[i][j] - a[i][j-1])){
                    pl("No");
                    return;
                }
            }
        } int j=1; int j=1; j 1 j<3 j 3 j++ j++ j {
            int r = -100000;
            for(int i=0;i<3;i++){
                if(r==-100000) {
                    r = a[i][j] - a[i][j-1];
                }else if(r!=(a[i][j] - a[i][j-1])){
                    pl("No");
                    return;
                }
            }
        } {
            int r = -100000;
            for(int i=0;i<3;i++){
                if(r==-100000) {
                    r = a[i][j] - a[i][j-1];
                }else if(r!=(a[i][j] - a[i][j-1])){
                    pl("No");
                    return;
                }
            }
        } int r = -100000; r -100000 100000 for(int i=0;i<3;i++){
                if(r==-100000) {
                    r = a[i][j] - a[i][j-1];
                }else if(r!=(a[i][j] - a[i][j-1])){
                    pl("No");
                    return;
                }
            } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
                if(r==-100000) {
                    r = a[i][j] - a[i][j-1];
                }else if(r!=(a[i][j] - a[i][j-1])){
                    pl("No");
                    return;
                }
            } {
                if(r==-100000) {
                    r = a[i][j] - a[i][j-1];
                }else if(r!=(a[i][j] - a[i][j-1])){
                    pl("No");
                    return;
                }
            } if(r==-100000) {
                    r = a[i][j] - a[i][j-1];
                }else if(r!=(a[i][j] - a[i][j-1])){
                    pl("No");
                    return;
                } r==-100000 r -100000 100000 {
                    r = a[i][j] - a[i][j-1];
                } r = a[i][j] - a[i][j-1] r a[i][j] - a[i][j-1] a[i][j] a[i] a i j a[i][j-1] a[i] a i j-1 j 1 if(r!=(a[i][j] - a[i][j-1])){
                    pl("No");
                    return;
                } r!=(a[i][j] - a[i][j-1]) r (a[i][j] - a[i][j-1]) a[i][j] a[i] a i j a[i][j-1] a[i] a i j-1 j 1 {
                    pl("No");
                    return;
                } pl("No") pl "No" return; pl("Yes") pl "Yes" public void S(){run();out.close(); } S {run();out.close(); } run() run out.close() out.close out public int ni(){return Integer.parseInt(in.ns());} ni {return Integer.parseInt(in.ns());} return Integer.parseInt(in.ns()); Integer.parseInt(in.ns()) Integer.parseInt Integer in.ns() in.ns in public long nl(){return Long.parseLong(in.ns());} nl {return Long.parseLong(in.ns());} return Long.parseLong(in.ns()); Long.parseLong(in.ns()) Long.parseLong Long in.ns() in.ns in public String ns(){return in.ns();} ns {return in.ns();} return in.ns(); in.ns() in.ns in public void p(Object obj){out.print(obj);} p {out.print(obj);} out.print(obj) out.print out obj Object obj obj public void ps(Object obj){p(obj);p(" ");} ps {p(obj);p(" ");} p(obj) p obj p(" ") p " " Object obj obj public void pl(Object obj){out.println(obj);} pl {out.println(obj);} out.println(obj) out.println out obj Object obj obj public int gcd(int a,int b){ while( b != 0 ) { int t = a % b;a = b;b = t; } return a; } gcd { while( b != 0 ) { int t = a % b;a = b;b = t; } return a; } while( b != 0 ) { int t = a % b;a = b;b = t; } b != 0 b 0 { int t = a % b;a = b;b = t; } int t = a % b; t a % b a b a = b a b b = t b t return a; a int a a int b b class B {
    public static int on = 0;

    public void run(){

    }
} B public static int on = 0; on 0 public void run(){

    } run {

    } class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream), 32768);
        tokenizer = null;
    }

    public String ns() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

} InputReader private BufferedReader reader; reader private StringTokenizer tokenizer; tokenizer public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream), 32768);
        tokenizer = null;
    } InputReader {
        reader = new BufferedReader(new InputStreamReader(stream), 32768);
        tokenizer = null;
    } reader = new BufferedReader(new InputStreamReader(stream), 32768) reader new BufferedReader(new InputStreamReader(stream), 32768) tokenizer = null tokenizer null InputStream stream stream public String ns() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    } ns {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    } while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        } tokenizer == null || !tokenizer.hasMoreTokens() tokenizer == null tokenizer null !tokenizer.hasMoreTokens() tokenizer.hasMoreTokens() tokenizer.hasMoreTokens tokenizer {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        } try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            } catch (IOException e) {
                throw new RuntimeException(e);
            } IOException e {
                throw new RuntimeException(e);
            } throw new RuntimeException(e); new RuntimeException(e) {
                tokenizer = new StringTokenizer(reader.readLine());
            } tokenizer = new StringTokenizer(reader.readLine()) tokenizer new StringTokenizer(reader.readLine()) return tokenizer.nextToken(); tokenizer.nextToken() tokenizer.nextToken tokenizer public class Main {

    public static void main(String[] args) {
        final String[] tasks = new String[]{"D","C","B","A"};
        for(final String task:tasks) {
            try {
                Class ca = Main.class.getClassLoader().loadClass(task);
                if (ca.getField("on").getInt(null) == 1) {
                    Object aTask = ca.newInstance();
                    Method m = ca.getMethod("S", null);
                    m.invoke(aTask, null);
                }
            } catch (Exception ex) { }
        }
    }

} public class Main {

    public static void main(String[] args) {
        final String[] tasks = new String[]{"D","C","B","A"};
        for(final String task:tasks) {
            try {
                Class ca = Main.class.getClassLoader().loadClass(task);
                if (ca.getField("on").getInt(null) == 1) {
                    Object aTask = ca.newInstance();
                    Method m = ca.getMethod("S", null);
                    m.invoke(aTask, null);
                }
            } catch (Exception ex) { }
        }
    }

} Main
import java.io.InputStreamReader;
import java.io.IOException;
import java.lang.reflect.Method;
import java.util.*;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import static java.lang.Math.*;

public class Main {

    public static void main(String[] args) {
        final String[] tasks = new String[]{"D","C","B","A"};
        for(final String task:tasks) {
            try {
                Class ca = Main.class.getClassLoader().loadClass(task);
                if (ca.getField("on").getInt(null) == 1) {
                    Object aTask = ca.newInstance();
                    Method m = ca.getMethod("S", null);
                    m.invoke(aTask, null);
                }
            } catch (Exception ex) { }
        }
    }

}

class A {
    public static int on = 1;

    public void run(){
        int[][] a = new int[3][3];
        for(int i=0;i<3;i++){
            for(int j=0;j<3;j++){
                a[i][j] = ni();
            }
        }

        for(int i=1;i<3;i++){
            int r = -100000;
            for(int j=0;j<3;j++){
                if(r==-100000) {
                    r = a[i][j] - a[i - 1][j];
                }else if(r!=(a[i][j] - a[i - 1][j])){
                    pl("No");
                    return;
                }
            }
        }


        for(int j=1;j<3;j++){
            int r = -100000;
            for(int i=0;i<3;i++){
                if(r==-100000) {
                    r = a[i][j] - a[i][j-1];
                }else if(r!=(a[i][j] - a[i][j-1])){
                    pl("No");
                    return;
                }
            }
        }
        pl("Yes");






    }
    private InputReader in =  new InputReader(System.in);
    private PrintWriter out = new PrintWriter(System.out);
    public void S(){run();out.close(); }
    public int ni(){return Integer.parseInt(in.ns());}
    public long nl(){return Long.parseLong(in.ns());}
    public String ns(){return in.ns();}
    public void p(Object obj){out.print(obj);}
    public void ps(Object obj){p(obj);p(" ");}
    public void pl(Object obj){out.println(obj);}
    public int gcd(int a,int b){ while( b != 0 ) { int t = a % b;a = b;b = t; } return a; }
}

class B {
    public static int on = 0;

    public void run(){

    }
}

class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream), 32768);
        tokenizer = null;
    }

    public String ns() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

}



