import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int board[][] = new int[3][3];
        for (int y = 0;y < 3;++y){
            for (int x = 0;x < 3;++x){
                board[x][y] = sc.nextInt();
            }
        }
        if(search(board)){
            System.out.println("Yes");
        }
        else System.out.println("No");
    }

    public static boolean search(int board[][]){
        int k = 0;
        for (int j = 1;j <= 2;++j){
            for (int i = 0;i < 3;++i){
                if(i == 0){
                    k = board[0][j] - board[0][0];
                }
                else{
                    if(k != board[i][j] - board[i][0]){
                        return false;
                    }
                }
            }
        }
        for (int j = 1;j <= 2;++j){
            for (int i = 0;i < 3;++i){
                if(i == 0){
                    k = board[j][0] - board[0][0];
                }
                else{
                    if(k != board[j][i] - board[0][i]){
                        return false;
                    }
                }
            }
        }
        return true;
    }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int board[][] = new int[3][3];
        for (int y = 0;y < 3;++y){
            for (int x = 0;x < 3;++x){
                board[x][y] = sc.nextInt();
            }
        }
        if(search(board)){
            System.out.println("Yes");
        }
        else System.out.println("No");
    }

    public static boolean search(int board[][]){
        int k = 0;
        for (int j = 1;j <= 2;++j){
            for (int i = 0;i < 3;++i){
                if(i == 0){
                    k = board[0][j] - board[0][0];
                }
                else{
                    if(k != board[i][j] - board[i][0]){
                        return false;
                    }
                }
            }
        }
        for (int j = 1;j <= 2;++j){
            for (int i = 0;i < 3;++i){
                if(i == 0){
                    k = board[j][0] - board[0][0];
                }
                else{
                    if(k != board[j][i] - board[0][i]){
                        return false;
                    }
                }
            }
        }
        return true;
    }
} Main public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int board[][] = new int[3][3];
        for (int y = 0;y < 3;++y){
            for (int x = 0;x < 3;++x){
                board[x][y] = sc.nextInt();
            }
        }
        if(search(board)){
            System.out.println("Yes");
        }
        else System.out.println("No");
    } main {
        Scanner sc = new Scanner(System.in);
        int board[][] = new int[3][3];
        for (int y = 0;y < 3;++y){
            for (int x = 0;x < 3;++x){
                board[x][y] = sc.nextInt();
            }
        }
        if(search(board)){
            System.out.println("Yes");
        }
        else System.out.println("No");
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int board[][] = new int[3][3]; board new int[3][3] 3 3 for (int y = 0;y < 3;++y){
            for (int x = 0;x < 3;++x){
                board[x][y] = sc.nextInt();
            }
        } int y = 0; int y = 0; y 0 y < 3 y 3 ++y ++y y {
            for (int x = 0;x < 3;++x){
                board[x][y] = sc.nextInt();
            }
        } {
            for (int x = 0;x < 3;++x){
                board[x][y] = sc.nextInt();
            }
        } for (int x = 0;x < 3;++x){
                board[x][y] = sc.nextInt();
            } int x = 0; int x = 0; x 0 x < 3 x 3 ++x ++x x {
                board[x][y] = sc.nextInt();
            } {
                board[x][y] = sc.nextInt();
            } board[x][y] = sc.nextInt() board[x][y] board[x] board x y sc.nextInt() sc.nextInt sc if(search(board)){
            System.out.println("Yes");
        }
        else System.out.println("No"); search(board) search board {
            System.out.println("Yes");
        } System.out.println("Yes") System.out.println System.out System System.out "Yes" System.out.println("No") System.out.println System.out System System.out "No" String args[] args public static boolean search(int board[][]){
        int k = 0;
        for (int j = 1;j <= 2;++j){
            for (int i = 0;i < 3;++i){
                if(i == 0){
                    k = board[0][j] - board[0][0];
                }
                else{
                    if(k != board[i][j] - board[i][0]){
                        return false;
                    }
                }
            }
        }
        for (int j = 1;j <= 2;++j){
            for (int i = 0;i < 3;++i){
                if(i == 0){
                    k = board[j][0] - board[0][0];
                }
                else{
                    if(k != board[j][i] - board[0][i]){
                        return false;
                    }
                }
            }
        }
        return true;
    } search {
        int k = 0;
        for (int j = 1;j <= 2;++j){
            for (int i = 0;i < 3;++i){
                if(i == 0){
                    k = board[0][j] - board[0][0];
                }
                else{
                    if(k != board[i][j] - board[i][0]){
                        return false;
                    }
                }
            }
        }
        for (int j = 1;j <= 2;++j){
            for (int i = 0;i < 3;++i){
                if(i == 0){
                    k = board[j][0] - board[0][0];
                }
                else{
                    if(k != board[j][i] - board[0][i]){
                        return false;
                    }
                }
            }
        }
        return true;
    } int k = 0; k 0 for (int j = 1;j <= 2;++j){
            for (int i = 0;i < 3;++i){
                if(i == 0){
                    k = board[0][j] - board[0][0];
                }
                else{
                    if(k != board[i][j] - board[i][0]){
                        return false;
                    }
                }
            }
        } int j = 1; int j = 1; j 1 j <= 2 j 2 ++j ++j j {
            for (int i = 0;i < 3;++i){
                if(i == 0){
                    k = board[0][j] - board[0][0];
                }
                else{
                    if(k != board[i][j] - board[i][0]){
                        return false;
                    }
                }
            }
        } {
            for (int i = 0;i < 3;++i){
                if(i == 0){
                    k = board[0][j] - board[0][0];
                }
                else{
                    if(k != board[i][j] - board[i][0]){
                        return false;
                    }
                }
            }
        } for (int i = 0;i < 3;++i){
                if(i == 0){
                    k = board[0][j] - board[0][0];
                }
                else{
                    if(k != board[i][j] - board[i][0]){
                        return false;
                    }
                }
            } int i = 0; int i = 0; i 0 i < 3 i 3 ++i ++i i {
                if(i == 0){
                    k = board[0][j] - board[0][0];
                }
                else{
                    if(k != board[i][j] - board[i][0]){
                        return false;
                    }
                }
            } {
                if(i == 0){
                    k = board[0][j] - board[0][0];
                }
                else{
                    if(k != board[i][j] - board[i][0]){
                        return false;
                    }
                }
            } if(i == 0){
                    k = board[0][j] - board[0][0];
                }
                else{
                    if(k != board[i][j] - board[i][0]){
                        return false;
                    }
                } i == 0 i 0 {
                    k = board[0][j] - board[0][0];
                } k = board[0][j] - board[0][0] k board[0][j] - board[0][0] board[0][j] board[0] board 0 j board[0][0] board[0] board 0 0 {
                    if(k != board[i][j] - board[i][0]){
                        return false;
                    }
                } if(k != board[i][j] - board[i][0]){
                        return false;
                    } k != board[i][j] - board[i][0] k board[i][j] - board[i][0] board[i][j] board[i] board i j board[i][0] board[i] board i 0 {
                        return false;
                    } return false; false for (int j = 1;j <= 2;++j){
            for (int i = 0;i < 3;++i){
                if(i == 0){
                    k = board[j][0] - board[0][0];
                }
                else{
                    if(k != board[j][i] - board[0][i]){
                        return false;
                    }
                }
            }
        } int j = 1; int j = 1; j 1 j <= 2 j 2 ++j ++j j {
            for (int i = 0;i < 3;++i){
                if(i == 0){
                    k = board[j][0] - board[0][0];
                }
                else{
                    if(k != board[j][i] - board[0][i]){
                        return false;
                    }
                }
            }
        } {
            for (int i = 0;i < 3;++i){
                if(i == 0){
                    k = board[j][0] - board[0][0];
                }
                else{
                    if(k != board[j][i] - board[0][i]){
                        return false;
                    }
                }
            }
        } for (int i = 0;i < 3;++i){
                if(i == 0){
                    k = board[j][0] - board[0][0];
                }
                else{
                    if(k != board[j][i] - board[0][i]){
                        return false;
                    }
                }
            } int i = 0; int i = 0; i 0 i < 3 i 3 ++i ++i i {
                if(i == 0){
                    k = board[j][0] - board[0][0];
                }
                else{
                    if(k != board[j][i] - board[0][i]){
                        return false;
                    }
                }
            } {
                if(i == 0){
                    k = board[j][0] - board[0][0];
                }
                else{
                    if(k != board[j][i] - board[0][i]){
                        return false;
                    }
                }
            } if(i == 0){
                    k = board[j][0] - board[0][0];
                }
                else{
                    if(k != board[j][i] - board[0][i]){
                        return false;
                    }
                } i == 0 i 0 {
                    k = board[j][0] - board[0][0];
                } k = board[j][0] - board[0][0] k board[j][0] - board[0][0] board[j][0] board[j] board j 0 board[0][0] board[0] board 0 0 {
                    if(k != board[j][i] - board[0][i]){
                        return false;
                    }
                } if(k != board[j][i] - board[0][i]){
                        return false;
                    } k != board[j][i] - board[0][i] k board[j][i] - board[0][i] board[j][i] board[j] board j i board[0][i] board[0] board 0 i {
                        return false;
                    } return false; false return true; true int board[][] board public class Main {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int board[][] = new int[3][3];
        for (int y = 0;y < 3;++y){
            for (int x = 0;x < 3;++x){
                board[x][y] = sc.nextInt();
            }
        }
        if(search(board)){
            System.out.println("Yes");
        }
        else System.out.println("No");
    }

    public static boolean search(int board[][]){
        int k = 0;
        for (int j = 1;j <= 2;++j){
            for (int i = 0;i < 3;++i){
                if(i == 0){
                    k = board[0][j] - board[0][0];
                }
                else{
                    if(k != board[i][j] - board[i][0]){
                        return false;
                    }
                }
            }
        }
        for (int j = 1;j <= 2;++j){
            for (int i = 0;i < 3;++i){
                if(i == 0){
                    k = board[j][0] - board[0][0];
                }
                else{
                    if(k != board[j][i] - board[0][i]){
                        return false;
                    }
                }
            }
        }
        return true;
    }
} public class Main {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int board[][] = new int[3][3];
        for (int y = 0;y < 3;++y){
            for (int x = 0;x < 3;++x){
                board[x][y] = sc.nextInt();
            }
        }
        if(search(board)){
            System.out.println("Yes");
        }
        else System.out.println("No");
    }

    public static boolean search(int board[][]){
        int k = 0;
        for (int j = 1;j <= 2;++j){
            for (int i = 0;i < 3;++i){
                if(i == 0){
                    k = board[0][j] - board[0][0];
                }
                else{
                    if(k != board[i][j] - board[i][0]){
                        return false;
                    }
                }
            }
        }
        for (int j = 1;j <= 2;++j){
            for (int i = 0;i < 3;++i){
                if(i == 0){
                    k = board[j][0] - board[0][0];
                }
                else{
                    if(k != board[j][i] - board[0][i]){
                        return false;
                    }
                }
            }
        }
        return true;
    }
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int board[][] = new int[3][3];
        for (int y = 0;y < 3;++y){
            for (int x = 0;x < 3;++x){
                board[x][y] = sc.nextInt();
            }
        }
        if(search(board)){
            System.out.println("Yes");
        }
        else System.out.println("No");
    }

    public static boolean search(int board[][]){
        int k = 0;
        for (int j = 1;j <= 2;++j){
            for (int i = 0;i < 3;++i){
                if(i == 0){
                    k = board[0][j] - board[0][0];
                }
                else{
                    if(k != board[i][j] - board[i][0]){
                        return false;
                    }
                }
            }
        }
        for (int j = 1;j <= 2;++j){
            for (int i = 0;i < 3;++i){
                if(i == 0){
                    k = board[j][0] - board[0][0];
                }
                else{
                    if(k != board[j][i] - board[0][i]){
                        return false;
                    }
                }
            }
        }
        return true;
    }
}