
import java.io.BufferedReader;

import java.io.IOException;

import java.io.InputStream;

import java.io.InputStreamReader;

import java.util.Arrays;

import java.util.Collections;

import java.util.Comparator;

import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) throws IOException {
        Reader.init(System.in);

        int[][] arr = new int[3][3];
        int row1 =0;
        int row2=0;
        int row3=0;int col1=0;int col2=0;int col3=0;
        int all=0;
        for(int i=0;i<3;i++){
            for(int j=0;j<3;j++){
                arr[i][j] = Reader.nextInt();
                all+= arr[i][j];
            }
        }

        int tem = arr[0][0] + arr[1][1] + arr[2][2];
        if((arr[0][0] + arr[1][1] + arr[2][2] == arr[0][2] + arr[1][1] + arr[2][0]) && ((double)all)/3 == (double)tem){
            System.out.println("Yes");
        }
        else{System.out.println("No");}
    }
}

class Reader {

    static BufferedReader reader;

    static StringTokenizer tokenizer;

    /** call this method to initialize reader for InputStream */

    static void init(InputStream input) {

        reader = new BufferedReader(

                new InputStreamReader(input) );



        tokenizer = new StringTokenizer("");

    }



    static String nextToken() {

        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {

                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {

                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    /** get next word */

    static String next() throws IOException {
        while ( ! tokenizer.hasMoreTokens() ) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                    reader.readLine() );
        }
        return tokenizer.nextToken();
    }
    static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }



    static double nextDouble() throws IOException {

        return Double.parseDouble( next() );

    }



    static long nextLong() {

        return Long.parseLong(nextToken());

    }


} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Arrays; Arrays java.util import java.util.Collections; Collections java.util import java.util.Comparator; Comparator java.util import java.util.StringTokenizer; StringTokenizer java.util public class Main {
    public static void main(String[] args) throws IOException {
        Reader.init(System.in);

        int[][] arr = new int[3][3];
        int row1 =0;
        int row2=0;
        int row3=0;int col1=0;int col2=0;int col3=0;
        int all=0;
        for(int i=0;i<3;i++){
            for(int j=0;j<3;j++){
                arr[i][j] = Reader.nextInt();
                all+= arr[i][j];
            }
        }

        int tem = arr[0][0] + arr[1][1] + arr[2][2];
        if((arr[0][0] + arr[1][1] + arr[2][2] == arr[0][2] + arr[1][1] + arr[2][0]) && ((double)all)/3 == (double)tem){
            System.out.println("Yes");
        }
        else{System.out.println("No");}
    }
} Main public static void main(String[] args) throws IOException {
        Reader.init(System.in);

        int[][] arr = new int[3][3];
        int row1 =0;
        int row2=0;
        int row3=0;int col1=0;int col2=0;int col3=0;
        int all=0;
        for(int i=0;i<3;i++){
            for(int j=0;j<3;j++){
                arr[i][j] = Reader.nextInt();
                all+= arr[i][j];
            }
        }

        int tem = arr[0][0] + arr[1][1] + arr[2][2];
        if((arr[0][0] + arr[1][1] + arr[2][2] == arr[0][2] + arr[1][1] + arr[2][0]) && ((double)all)/3 == (double)tem){
            System.out.println("Yes");
        }
        else{System.out.println("No");}
    } main {
        Reader.init(System.in);

        int[][] arr = new int[3][3];
        int row1 =0;
        int row2=0;
        int row3=0;int col1=0;int col2=0;int col3=0;
        int all=0;
        for(int i=0;i<3;i++){
            for(int j=0;j<3;j++){
                arr[i][j] = Reader.nextInt();
                all+= arr[i][j];
            }
        }

        int tem = arr[0][0] + arr[1][1] + arr[2][2];
        if((arr[0][0] + arr[1][1] + arr[2][2] == arr[0][2] + arr[1][1] + arr[2][0]) && ((double)all)/3 == (double)tem){
            System.out.println("Yes");
        }
        else{System.out.println("No");}
    } Reader.init(System.in) Reader.init Reader System.in System System.in int[][] arr = new int[3][3]; arr new int[3][3] 3 3 int row1 =0; row1 0 int row2=0; row2 0 int row3=0; row3 0 int col1=0; col1 0 int col2=0; col2 0 int col3=0; col3 0 int all=0; all 0 for(int i=0;i<3;i++){
            for(int j=0;j<3;j++){
                arr[i][j] = Reader.nextInt();
                all+= arr[i][j];
            }
        } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
            for(int j=0;j<3;j++){
                arr[i][j] = Reader.nextInt();
                all+= arr[i][j];
            }
        } {
            for(int j=0;j<3;j++){
                arr[i][j] = Reader.nextInt();
                all+= arr[i][j];
            }
        } for(int j=0;j<3;j++){
                arr[i][j] = Reader.nextInt();
                all+= arr[i][j];
            } int j=0; int j=0; j 0 j<3 j 3 j++ j++ j {
                arr[i][j] = Reader.nextInt();
                all+= arr[i][j];
            } {
                arr[i][j] = Reader.nextInt();
                all+= arr[i][j];
            } arr[i][j] = Reader.nextInt() arr[i][j] arr[i] arr i j Reader.nextInt() Reader.nextInt Reader all+= arr[i][j] all arr[i][j] arr[i] arr i j int tem = arr[0][0] + arr[1][1] + arr[2][2]; tem arr[0][0] + arr[1][1] + arr[2][2] arr[0][0] + arr[1][1] + arr[2][2] arr[0][0] arr[0] arr 0 0 arr[1][1] arr[1] arr 1 1 arr[2][2] arr[2] arr 2 2 if((arr[0][0] + arr[1][1] + arr[2][2] == arr[0][2] + arr[1][1] + arr[2][0]) && ((double)all)/3 == (double)tem){
            System.out.println("Yes");
        }
        else{System.out.println("No");} (arr[0][0] + arr[1][1] + arr[2][2] == arr[0][2] + arr[1][1] + arr[2][0]) && ((double)all)/3 == (double)tem (arr[0][0] + arr[1][1] + arr[2][2] == arr[0][2] + arr[1][1] + arr[2][0]) arr[0][0] + arr[1][1] + arr[2][2] arr[0][0] + arr[1][1] + arr[2][2] arr[0][0] arr[0] arr 0 0 arr[1][1] arr[1] arr 1 1 arr[2][2] arr[2] arr 2 2 arr[0][2] + arr[1][1] + arr[2][0] arr[0][2] + arr[1][1] + arr[2][0] arr[0][2] arr[0] arr 0 2 arr[1][1] arr[1] arr 1 1 arr[2][0] arr[2] arr 2 0 ((double)all)/3 == (double)tem ((double)all)/3 ((double)all) 3 (double)tem {
            System.out.println("Yes");
        } System.out.println("Yes") System.out.println System.out System System.out "Yes" {System.out.println("No");} System.out.println("No") System.out.println System.out System System.out "No" String[] args args class Reader {

    static BufferedReader reader;

    static StringTokenizer tokenizer;

    /** call this method to initialize reader for InputStream */

    static void init(InputStream input) {

        reader = new BufferedReader(

                new InputStreamReader(input) );



        tokenizer = new StringTokenizer("");

    }



    static String nextToken() {

        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {

                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {

                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    /** get next word */

    static String next() throws IOException {
        while ( ! tokenizer.hasMoreTokens() ) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                    reader.readLine() );
        }
        return tokenizer.nextToken();
    }
    static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }



    static double nextDouble() throws IOException {

        return Double.parseDouble( next() );

    }



    static long nextLong() {

        return Long.parseLong(nextToken());

    }


} Reader static BufferedReader reader; reader static StringTokenizer tokenizer; tokenizer /** call this method to initialize reader for InputStream */

    static void init(InputStream input) {

        reader = new BufferedReader(

                new InputStreamReader(input) );



        tokenizer = new StringTokenizer("");

    } init {

        reader = new BufferedReader(

                new InputStreamReader(input) );



        tokenizer = new StringTokenizer("");

    } reader = new BufferedReader(

                new InputStreamReader(input) ) reader new BufferedReader(

                new InputStreamReader(input) ) tokenizer = new StringTokenizer("") tokenizer new StringTokenizer("") InputStream input input static String nextToken() {

        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {

                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {

                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    } nextToken {

        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 /** get next word */

    static String next() throws IOException {
        while ( ! tokenizer.hasMoreTokens() ) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                    reader.readLine() );
        }
        return tokenizer.nextToken();
    } next {
        while ( ! tokenizer.hasMoreTokens() ) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                    reader.readLine() );
        }
        return tokenizer.nextToken();
    } while ( ! tokenizer.hasMoreTokens() ) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                    reader.readLine() );
        } ! tokenizer.hasMoreTokens() tokenizer.hasMoreTokens() tokenizer.hasMoreTokens tokenizer {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                    reader.readLine() );
        } tokenizer = new StringTokenizer(
                    reader.readLine() ) tokenizer new StringTokenizer(
                    reader.readLine() ) return tokenizer.nextToken(); tokenizer.nextToken() tokenizer.nextToken tokenizer static int nextInt() throws IOException {
        return Integer.parseInt(next());
    } nextInt {
        return Integer.parseInt(next());
    } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next static double nextDouble() throws IOException {

        return Double.parseDouble( next() );

    } nextDouble {

        return Double.parseDouble( next() );

    } return Double.parseDouble( next() ); Double.parseDouble( next() ) Double.parseDouble Double next() next static long nextLong() {

        return Long.parseLong(nextToken());

    } nextLong {

        return Long.parseLong(nextToken());

    } return Long.parseLong(nextToken()); Long.parseLong(nextToken()) Long.parseLong Long nextToken() nextToken public class Main {
    public static void main(String[] args) throws IOException {
        Reader.init(System.in);

        int[][] arr = new int[3][3];
        int row1 =0;
        int row2=0;
        int row3=0;int col1=0;int col2=0;int col3=0;
        int all=0;
        for(int i=0;i<3;i++){
            for(int j=0;j<3;j++){
                arr[i][j] = Reader.nextInt();
                all+= arr[i][j];
            }
        }

        int tem = arr[0][0] + arr[1][1] + arr[2][2];
        if((arr[0][0] + arr[1][1] + arr[2][2] == arr[0][2] + arr[1][1] + arr[2][0]) && ((double)all)/3 == (double)tem){
            System.out.println("Yes");
        }
        else{System.out.println("No");}
    }
} public class Main {
    public static void main(String[] args) throws IOException {
        Reader.init(System.in);

        int[][] arr = new int[3][3];
        int row1 =0;
        int row2=0;
        int row3=0;int col1=0;int col2=0;int col3=0;
        int all=0;
        for(int i=0;i<3;i++){
            for(int j=0;j<3;j++){
                arr[i][j] = Reader.nextInt();
                all+= arr[i][j];
            }
        }

        int tem = arr[0][0] + arr[1][1] + arr[2][2];
        if((arr[0][0] + arr[1][1] + arr[2][2] == arr[0][2] + arr[1][1] + arr[2][0]) && ((double)all)/3 == (double)tem){
            System.out.println("Yes");
        }
        else{System.out.println("No");}
    }
} Main

import java.io.BufferedReader;

import java.io.IOException;

import java.io.InputStream;

import java.io.InputStreamReader;

import java.util.Arrays;

import java.util.Collections;

import java.util.Comparator;

import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) throws IOException {
        Reader.init(System.in);

        int[][] arr = new int[3][3];
        int row1 =0;
        int row2=0;
        int row3=0;int col1=0;int col2=0;int col3=0;
        int all=0;
        for(int i=0;i<3;i++){
            for(int j=0;j<3;j++){
                arr[i][j] = Reader.nextInt();
                all+= arr[i][j];
            }
        }

        int tem = arr[0][0] + arr[1][1] + arr[2][2];
        if((arr[0][0] + arr[1][1] + arr[2][2] == arr[0][2] + arr[1][1] + arr[2][0]) && ((double)all)/3 == (double)tem){
            System.out.println("Yes");
        }
        else{System.out.println("No");}
    }
}

class Reader {

    static BufferedReader reader;

    static StringTokenizer tokenizer;

    /** call this method to initialize reader for InputStream */

    static void init(InputStream input) {

        reader = new BufferedReader(

                new InputStreamReader(input) );



        tokenizer = new StringTokenizer("");

    }



    static String nextToken() {

        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {

                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {

                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    /** get next word */

    static String next() throws IOException {
        while ( ! tokenizer.hasMoreTokens() ) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                    reader.readLine() );
        }
        return tokenizer.nextToken();
    }
    static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }



    static double nextDouble() throws IOException {

        return Double.parseDouble( next() );

    }



    static long nextLong() {

        return Long.parseLong(nextToken());

    }


}
