import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][] g = new int[3][3];
        for (int i = 0; i < 3; i++) {
            g[i][0] = sc.nextInt();
            g[i][1] = sc.nextInt();
            g[i][2] = sc.nextInt();
        }
        boolean ans = true;
        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < 2; j++) {
                if(g[i][j] - g[i+1][j] != g[i][j+1] - g[i+1][j+1]){
                    ans = false;
                    break;
                }
                if(g[i][j] - g[i][j+1] != g[i+1][j] - g[i+1][j+1]){
                    ans = false;
                    break;
                }
            }
        }

        if(ans) System.out.println("Yes");
        else System.out.println("No");
        sc.close();
    }

} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][] g = new int[3][3];
        for (int i = 0; i < 3; i++) {
            g[i][0] = sc.nextInt();
            g[i][1] = sc.nextInt();
            g[i][2] = sc.nextInt();
        }
        boolean ans = true;
        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < 2; j++) {
                if(g[i][j] - g[i+1][j] != g[i][j+1] - g[i+1][j+1]){
                    ans = false;
                    break;
                }
                if(g[i][j] - g[i][j+1] != g[i+1][j] - g[i+1][j+1]){
                    ans = false;
                    break;
                }
            }
        }

        if(ans) System.out.println("Yes");
        else System.out.println("No");
        sc.close();
    }

} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][] g = new int[3][3];
        for (int i = 0; i < 3; i++) {
            g[i][0] = sc.nextInt();
            g[i][1] = sc.nextInt();
            g[i][2] = sc.nextInt();
        }
        boolean ans = true;
        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < 2; j++) {
                if(g[i][j] - g[i+1][j] != g[i][j+1] - g[i+1][j+1]){
                    ans = false;
                    break;
                }
                if(g[i][j] - g[i][j+1] != g[i+1][j] - g[i+1][j+1]){
                    ans = false;
                    break;
                }
            }
        }

        if(ans) System.out.println("Yes");
        else System.out.println("No");
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        int[][] g = new int[3][3];
        for (int i = 0; i < 3; i++) {
            g[i][0] = sc.nextInt();
            g[i][1] = sc.nextInt();
            g[i][2] = sc.nextInt();
        }
        boolean ans = true;
        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < 2; j++) {
                if(g[i][j] - g[i+1][j] != g[i][j+1] - g[i+1][j+1]){
                    ans = false;
                    break;
                }
                if(g[i][j] - g[i][j+1] != g[i+1][j] - g[i+1][j+1]){
                    ans = false;
                    break;
                }
            }
        }

        if(ans) System.out.println("Yes");
        else System.out.println("No");
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[][] g = new int[3][3]; g new int[3][3] 3 3 for (int i = 0; i < 3; i++) {
            g[i][0] = sc.nextInt();
            g[i][1] = sc.nextInt();
            g[i][2] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            g[i][0] = sc.nextInt();
            g[i][1] = sc.nextInt();
            g[i][2] = sc.nextInt();
        } {
            g[i][0] = sc.nextInt();
            g[i][1] = sc.nextInt();
            g[i][2] = sc.nextInt();
        } g[i][0] = sc.nextInt() g[i][0] g[i] g i 0 sc.nextInt() sc.nextInt sc g[i][1] = sc.nextInt() g[i][1] g[i] g i 1 sc.nextInt() sc.nextInt sc g[i][2] = sc.nextInt() g[i][2] g[i] g i 2 sc.nextInt() sc.nextInt sc boolean ans = true; ans true for (int i = 0; i < 2; i++) {
            for (int j = 0; j < 2; j++) {
                if(g[i][j] - g[i+1][j] != g[i][j+1] - g[i+1][j+1]){
                    ans = false;
                    break;
                }
                if(g[i][j] - g[i][j+1] != g[i+1][j] - g[i+1][j+1]){
                    ans = false;
                    break;
                }
            }
        } int i = 0; int i = 0; i 0 i < 2 i 2 i++ i++ i {
            for (int j = 0; j < 2; j++) {
                if(g[i][j] - g[i+1][j] != g[i][j+1] - g[i+1][j+1]){
                    ans = false;
                    break;
                }
                if(g[i][j] - g[i][j+1] != g[i+1][j] - g[i+1][j+1]){
                    ans = false;
                    break;
                }
            }
        } {
            for (int j = 0; j < 2; j++) {
                if(g[i][j] - g[i+1][j] != g[i][j+1] - g[i+1][j+1]){
                    ans = false;
                    break;
                }
                if(g[i][j] - g[i][j+1] != g[i+1][j] - g[i+1][j+1]){
                    ans = false;
                    break;
                }
            }
        } for (int j = 0; j < 2; j++) {
                if(g[i][j] - g[i+1][j] != g[i][j+1] - g[i+1][j+1]){
                    ans = false;
                    break;
                }
                if(g[i][j] - g[i][j+1] != g[i+1][j] - g[i+1][j+1]){
                    ans = false;
                    break;
                }
            } int j = 0; int j = 0; j 0 j < 2 j 2 j++ j++ j {
                if(g[i][j] - g[i+1][j] != g[i][j+1] - g[i+1][j+1]){
                    ans = false;
                    break;
                }
                if(g[i][j] - g[i][j+1] != g[i+1][j] - g[i+1][j+1]){
                    ans = false;
                    break;
                }
            } {
                if(g[i][j] - g[i+1][j] != g[i][j+1] - g[i+1][j+1]){
                    ans = false;
                    break;
                }
                if(g[i][j] - g[i][j+1] != g[i+1][j] - g[i+1][j+1]){
                    ans = false;
                    break;
                }
            } if(g[i][j] - g[i+1][j] != g[i][j+1] - g[i+1][j+1]){
                    ans = false;
                    break;
                } g[i][j] - g[i+1][j] != g[i][j+1] - g[i+1][j+1] g[i][j] - g[i+1][j] g[i][j] g[i] g i j g[i+1][j] g[i+1] g i+1 i 1 j g[i][j+1] - g[i+1][j+1] g[i][j+1] g[i] g i j+1 j 1 g[i+1][j+1] g[i+1] g i+1 i 1 j+1 j 1 {
                    ans = false;
                    break;
                } ans = false ans false break; if(g[i][j] - g[i][j+1] != g[i+1][j] - g[i+1][j+1]){
                    ans = false;
                    break;
                } g[i][j] - g[i][j+1] != g[i+1][j] - g[i+1][j+1] g[i][j] - g[i][j+1] g[i][j] g[i] g i j g[i][j+1] g[i] g i j+1 j 1 g[i+1][j] - g[i+1][j+1] g[i+1][j] g[i+1] g i+1 i 1 j g[i+1][j+1] g[i+1] g i+1 i 1 j+1 j 1 {
                    ans = false;
                    break;
                } ans = false ans false break; if(ans) System.out.println("Yes");
        else System.out.println("No"); ans 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" sc.close() sc.close sc String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][] g = new int[3][3];
        for (int i = 0; i < 3; i++) {
            g[i][0] = sc.nextInt();
            g[i][1] = sc.nextInt();
            g[i][2] = sc.nextInt();
        }
        boolean ans = true;
        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < 2; j++) {
                if(g[i][j] - g[i+1][j] != g[i][j+1] - g[i+1][j+1]){
                    ans = false;
                    break;
                }
                if(g[i][j] - g[i][j+1] != g[i+1][j] - g[i+1][j+1]){
                    ans = false;
                    break;
                }
            }
        }

        if(ans) System.out.println("Yes");
        else System.out.println("No");
        sc.close();
    }

} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][] g = new int[3][3];
        for (int i = 0; i < 3; i++) {
            g[i][0] = sc.nextInt();
            g[i][1] = sc.nextInt();
            g[i][2] = sc.nextInt();
        }
        boolean ans = true;
        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < 2; j++) {
                if(g[i][j] - g[i+1][j] != g[i][j+1] - g[i+1][j+1]){
                    ans = false;
                    break;
                }
                if(g[i][j] - g[i][j+1] != g[i+1][j] - g[i+1][j+1]){
                    ans = false;
                    break;
                }
            }
        }

        if(ans) System.out.println("Yes");
        else System.out.println("No");
        sc.close();
    }

} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][] g = new int[3][3];
        for (int i = 0; i < 3; i++) {
            g[i][0] = sc.nextInt();
            g[i][1] = sc.nextInt();
            g[i][2] = sc.nextInt();
        }
        boolean ans = true;
        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < 2; j++) {
                if(g[i][j] - g[i+1][j] != g[i][j+1] - g[i+1][j+1]){
                    ans = false;
                    break;
                }
                if(g[i][j] - g[i][j+1] != g[i+1][j] - g[i+1][j+1]){
                    ans = false;
                    break;
                }
            }
        }

        if(ans) System.out.println("Yes");
        else System.out.println("No");
        sc.close();
    }

}
