import java.util.Scanner;

public class Main {
    public Main () {
        Scanner sc = new Scanner(System.in);
        int n = 3;

        int[][] a = new int[n][n];

        for (int i = 0; i < n; i++)
            for (int j = 0; j < n; j++)
                a[i][j] = sc.nextInt();


        int[] b1 = dif(a[0]);
        int[] b2 = dif(a[1]);
        int[] b3 = dif(a[2]);

        if (b1[0] == b2[0] && b1[1] == b2[1]
                && b2[0] == b3[0] && b2[1] == b3[1])
            System.out.println("Yes");
        else System.out.println("No");
    }

    private int[] dif(int a[]) {
        return new int[]{a[1] - a[0], a[2] - a[1]};
    }

    public static void main (String[] args) {
        new Main();
    }

} import java.util.Scanner; Scanner java.util public class Main {
    public Main () {
        Scanner sc = new Scanner(System.in);
        int n = 3;

        int[][] a = new int[n][n];

        for (int i = 0; i < n; i++)
            for (int j = 0; j < n; j++)
                a[i][j] = sc.nextInt();


        int[] b1 = dif(a[0]);
        int[] b2 = dif(a[1]);
        int[] b3 = dif(a[2]);

        if (b1[0] == b2[0] && b1[1] == b2[1]
                && b2[0] == b3[0] && b2[1] == b3[1])
            System.out.println("Yes");
        else System.out.println("No");
    }

    private int[] dif(int a[]) {
        return new int[]{a[1] - a[0], a[2] - a[1]};
    }

    public static void main (String[] args) {
        new Main();
    }

} Main public Main () {
        Scanner sc = new Scanner(System.in);
        int n = 3;

        int[][] a = new int[n][n];

        for (int i = 0; i < n; i++)
            for (int j = 0; j < n; j++)
                a[i][j] = sc.nextInt();


        int[] b1 = dif(a[0]);
        int[] b2 = dif(a[1]);
        int[] b3 = dif(a[2]);

        if (b1[0] == b2[0] && b1[1] == b2[1]
                && b2[0] == b3[0] && b2[1] == b3[1])
            System.out.println("Yes");
        else System.out.println("No");
    } Main {
        Scanner sc = new Scanner(System.in);
        int n = 3;

        int[][] a = new int[n][n];

        for (int i = 0; i < n; i++)
            for (int j = 0; j < n; j++)
                a[i][j] = sc.nextInt();


        int[] b1 = dif(a[0]);
        int[] b2 = dif(a[1]);
        int[] b3 = dif(a[2]);

        if (b1[0] == b2[0] && b1[1] == b2[1]
                && b2[0] == b3[0] && b2[1] == b3[1])
            System.out.println("Yes");
        else System.out.println("No");
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = 3; n 3 int[][] a = new int[n][n]; a new int[n][n] n n for (int i = 0; i < n; i++)
            for (int j = 0; j < n; j++)
                a[i][j] = sc.nextInt(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i for (int j = 0; j < n; j++)
                a[i][j] = sc.nextInt(); for (int j = 0; j < n; j++)
                a[i][j] = sc.nextInt(); int j = 0; int j = 0; j 0 j < n j n j++ j++ j a[i][j] = sc.nextInt(); a[i][j] = sc.nextInt() a[i][j] a[i] a i j sc.nextInt() sc.nextInt sc int[] b1 = dif(a[0]); b1 dif(a[0]) dif a[0] a 0 int[] b2 = dif(a[1]); b2 dif(a[1]) dif a[1] a 1 int[] b3 = dif(a[2]); b3 dif(a[2]) dif a[2] a 2 if (b1[0] == b2[0] && b1[1] == b2[1]
                && b2[0] == b3[0] && b2[1] == b3[1])
            System.out.println("Yes");
        else System.out.println("No"); b1[0] == b2[0] && b1[1] == b2[1]
                && b2[0] == b3[0] && b2[1] == b3[1] b2[0] == b3[0] b1[0] == b2[0] && b1[1] == b2[1]
                && b2[0] == b3[0] && b2[1] == b3[1] b1[0] == b2[0] b1[0] b1 0 b2[0] b2 0 b1[1] == b2[1] b1[1] b1 1 b2[1] b2 1 b2[0] == b3[0] b2[0] b2 0 b3[0] b3 0 b2[1] == b3[1] b2[1] b2 1 b3[1] b3 1 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" private int[] dif(int a[]) {
        return new int[]{a[1] - a[0], a[2] - a[1]};
    } dif {
        return new int[]{a[1] - a[0], a[2] - a[1]};
    } return new int[]{a[1] - a[0], a[2] - a[1]}; new int[]{a[1] - a[0], a[2] - a[1]} int a[] a public static void main (String[] args) {
        new Main();
    } main {
        new Main();
    } new Main() String[] args args public class Main {
    public Main () {
        Scanner sc = new Scanner(System.in);
        int n = 3;

        int[][] a = new int[n][n];

        for (int i = 0; i < n; i++)
            for (int j = 0; j < n; j++)
                a[i][j] = sc.nextInt();


        int[] b1 = dif(a[0]);
        int[] b2 = dif(a[1]);
        int[] b3 = dif(a[2]);

        if (b1[0] == b2[0] && b1[1] == b2[1]
                && b2[0] == b3[0] && b2[1] == b3[1])
            System.out.println("Yes");
        else System.out.println("No");
    }

    private int[] dif(int a[]) {
        return new int[]{a[1] - a[0], a[2] - a[1]};
    }

    public static void main (String[] args) {
        new Main();
    }

} public class Main {
    public Main () {
        Scanner sc = new Scanner(System.in);
        int n = 3;

        int[][] a = new int[n][n];

        for (int i = 0; i < n; i++)
            for (int j = 0; j < n; j++)
                a[i][j] = sc.nextInt();


        int[] b1 = dif(a[0]);
        int[] b2 = dif(a[1]);
        int[] b3 = dif(a[2]);

        if (b1[0] == b2[0] && b1[1] == b2[1]
                && b2[0] == b3[0] && b2[1] == b3[1])
            System.out.println("Yes");
        else System.out.println("No");
    }

    private int[] dif(int a[]) {
        return new int[]{a[1] - a[0], a[2] - a[1]};
    }

    public static void main (String[] args) {
        new Main();
    }

} Main
import java.util.Scanner;

public class Main {
    public Main () {
        Scanner sc = new Scanner(System.in);
        int n = 3;

        int[][] a = new int[n][n];

        for (int i = 0; i < n; i++)
            for (int j = 0; j < n; j++)
                a[i][j] = sc.nextInt();


        int[] b1 = dif(a[0]);
        int[] b2 = dif(a[1]);
        int[] b3 = dif(a[2]);

        if (b1[0] == b2[0] && b1[1] == b2[1]
                && b2[0] == b3[0] && b2[1] == b3[1])
            System.out.println("Yes");
        else System.out.println("No");
    }

    private int[] dif(int a[]) {
        return new int[]{a[1] - a[0], a[2] - a[1]};
    }

    public static void main (String[] args) {
        new Main();
    }

}
