public class Main {
    private static java.util.Scanner scanner = new java.util.Scanner(System.in);

    public static void main(String[] args) {
        int max1 = 100, max2 = 100, max3 = 100, a[] = new int[9];
        for (int i = 0; i < 3; i++) {
            max1 = Math.min(max1, a[i * 3] = scanner.nextInt());
            max2 = Math.min(max2, a[i * 3 + 1] = scanner.nextInt());
            max3 = Math.min(max3, a[i * 3 + 2] = scanner.nextInt());
        }

        System.out.println((a[0] - max1 == a[1] - max2 && a[1] - max2 == a[2] - max3) &&
                (a[3] - max1 == a[4] - max2 && a[4] - max2 == a[5] - max3) &&
                (a[6] - max1 == a[7] - max2 && a[7] - max2 == a[8] - max3) ? "Yes" : "No");
    }
} public class Main {
    private static java.util.Scanner scanner = new java.util.Scanner(System.in);

    public static void main(String[] args) {
        int max1 = 100, max2 = 100, max3 = 100, a[] = new int[9];
        for (int i = 0; i < 3; i++) {
            max1 = Math.min(max1, a[i * 3] = scanner.nextInt());
            max2 = Math.min(max2, a[i * 3 + 1] = scanner.nextInt());
            max3 = Math.min(max3, a[i * 3 + 2] = scanner.nextInt());
        }

        System.out.println((a[0] - max1 == a[1] - max2 && a[1] - max2 == a[2] - max3) &&
                (a[3] - max1 == a[4] - max2 && a[4] - max2 == a[5] - max3) &&
                (a[6] - max1 == a[7] - max2 && a[7] - max2 == a[8] - max3) ? "Yes" : "No");
    }
} Main private static java.util.Scanner scanner = new java.util.Scanner(System.in); scanner new java.util.Scanner(System.in) public static void main(String[] args) {
        int max1 = 100, max2 = 100, max3 = 100, a[] = new int[9];
        for (int i = 0; i < 3; i++) {
            max1 = Math.min(max1, a[i * 3] = scanner.nextInt());
            max2 = Math.min(max2, a[i * 3 + 1] = scanner.nextInt());
            max3 = Math.min(max3, a[i * 3 + 2] = scanner.nextInt());
        }

        System.out.println((a[0] - max1 == a[1] - max2 && a[1] - max2 == a[2] - max3) &&
                (a[3] - max1 == a[4] - max2 && a[4] - max2 == a[5] - max3) &&
                (a[6] - max1 == a[7] - max2 && a[7] - max2 == a[8] - max3) ? "Yes" : "No");
    } main {
        int max1 = 100, max2 = 100, max3 = 100, a[] = new int[9];
        for (int i = 0; i < 3; i++) {
            max1 = Math.min(max1, a[i * 3] = scanner.nextInt());
            max2 = Math.min(max2, a[i * 3 + 1] = scanner.nextInt());
            max3 = Math.min(max3, a[i * 3 + 2] = scanner.nextInt());
        }

        System.out.println((a[0] - max1 == a[1] - max2 && a[1] - max2 == a[2] - max3) &&
                (a[3] - max1 == a[4] - max2 && a[4] - max2 == a[5] - max3) &&
                (a[6] - max1 == a[7] - max2 && a[7] - max2 == a[8] - max3) ? "Yes" : "No");
    } int max1 = 100 max1 100 max2 = 100 max2 100 max3 = 100 max3 100 a[] = new int[9]; a new int[9] 9 for (int i = 0; i < 3; i++) {
            max1 = Math.min(max1, a[i * 3] = scanner.nextInt());
            max2 = Math.min(max2, a[i * 3 + 1] = scanner.nextInt());
            max3 = Math.min(max3, a[i * 3 + 2] = scanner.nextInt());
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            max1 = Math.min(max1, a[i * 3] = scanner.nextInt());
            max2 = Math.min(max2, a[i * 3 + 1] = scanner.nextInt());
            max3 = Math.min(max3, a[i * 3 + 2] = scanner.nextInt());
        } {
            max1 = Math.min(max1, a[i * 3] = scanner.nextInt());
            max2 = Math.min(max2, a[i * 3 + 1] = scanner.nextInt());
            max3 = Math.min(max3, a[i * 3 + 2] = scanner.nextInt());
        } max1 = Math.min(max1, a[i * 3] = scanner.nextInt()) max1 Math.min(max1, a[i * 3] = scanner.nextInt()) Math.min Math max1 a[i * 3] = scanner.nextInt() a[i * 3] a i * 3 i 3 scanner.nextInt() scanner.nextInt scanner max2 = Math.min(max2, a[i * 3 + 1] = scanner.nextInt()) max2 Math.min(max2, a[i * 3 + 1] = scanner.nextInt()) Math.min Math max2 a[i * 3 + 1] = scanner.nextInt() a[i * 3 + 1] a i * 3 + 1 i * 3 i 3 1 scanner.nextInt() scanner.nextInt scanner max3 = Math.min(max3, a[i * 3 + 2] = scanner.nextInt()) max3 Math.min(max3, a[i * 3 + 2] = scanner.nextInt()) Math.min Math max3 a[i * 3 + 2] = scanner.nextInt() a[i * 3 + 2] a i * 3 + 2 i * 3 i 3 2 scanner.nextInt() scanner.nextInt scanner System.out.println((a[0] - max1 == a[1] - max2 && a[1] - max2 == a[2] - max3) &&
                (a[3] - max1 == a[4] - max2 && a[4] - max2 == a[5] - max3) &&
                (a[6] - max1 == a[7] - max2 && a[7] - max2 == a[8] - max3) ? "Yes" : "No") System.out.println System.out System System.out (a[0] - max1 == a[1] - max2 && a[1] - max2 == a[2] - max3) &&
                (a[3] - max1 == a[4] - max2 && a[4] - max2 == a[5] - max3) &&
                (a[6] - max1 == a[7] - max2 && a[7] - max2 == a[8] - max3) ? "Yes" : "No" (a[0] - max1 == a[1] - max2 && a[1] - max2 == a[2] - max3) &&
                (a[3] - max1 == a[4] - max2 && a[4] - max2 == a[5] - max3) &&
                (a[6] - max1 == a[7] - max2 && a[7] - max2 == a[8] - max3) (a[0] - max1 == a[1] - max2 && a[1] - max2 == a[2] - max3) &&
                (a[3] - max1 == a[4] - max2 && a[4] - max2 == a[5] - max3) &&
                (a[6] - max1 == a[7] - max2 && a[7] - max2 == a[8] - max3) (a[0] - max1 == a[1] - max2 && a[1] - max2 == a[2] - max3) a[0] - max1 == a[1] - max2 a[0] - max1 a[0] a 0 max1 a[1] - max2 a[1] a 1 max2 a[1] - max2 == a[2] - max3 a[1] - max2 a[1] a 1 max2 a[2] - max3 a[2] a 2 max3 (a[3] - max1 == a[4] - max2 && a[4] - max2 == a[5] - max3) a[3] - max1 == a[4] - max2 a[3] - max1 a[3] a 3 max1 a[4] - max2 a[4] a 4 max2 a[4] - max2 == a[5] - max3 a[4] - max2 a[4] a 4 max2 a[5] - max3 a[5] a 5 max3 (a[6] - max1 == a[7] - max2 && a[7] - max2 == a[8] - max3) a[6] - max1 == a[7] - max2 a[6] - max1 a[6] a 6 max1 a[7] - max2 a[7] a 7 max2 a[7] - max2 == a[8] - max3 a[7] - max2 a[7] a 7 max2 a[8] - max3 a[8] a 8 max3 "Yes" "No" String[] args args public class Main {
    private static java.util.Scanner scanner = new java.util.Scanner(System.in);

    public static void main(String[] args) {
        int max1 = 100, max2 = 100, max3 = 100, a[] = new int[9];
        for (int i = 0; i < 3; i++) {
            max1 = Math.min(max1, a[i * 3] = scanner.nextInt());
            max2 = Math.min(max2, a[i * 3 + 1] = scanner.nextInt());
            max3 = Math.min(max3, a[i * 3 + 2] = scanner.nextInt());
        }

        System.out.println((a[0] - max1 == a[1] - max2 && a[1] - max2 == a[2] - max3) &&
                (a[3] - max1 == a[4] - max2 && a[4] - max2 == a[5] - max3) &&
                (a[6] - max1 == a[7] - max2 && a[7] - max2 == a[8] - max3) ? "Yes" : "No");
    }
} public class Main {
    private static java.util.Scanner scanner = new java.util.Scanner(System.in);

    public static void main(String[] args) {
        int max1 = 100, max2 = 100, max3 = 100, a[] = new int[9];
        for (int i = 0; i < 3; i++) {
            max1 = Math.min(max1, a[i * 3] = scanner.nextInt());
            max2 = Math.min(max2, a[i * 3 + 1] = scanner.nextInt());
            max3 = Math.min(max3, a[i * 3 + 2] = scanner.nextInt());
        }

        System.out.println((a[0] - max1 == a[1] - max2 && a[1] - max2 == a[2] - max3) &&
                (a[3] - max1 == a[4] - max2 && a[4] - max2 == a[5] - max3) &&
                (a[6] - max1 == a[7] - max2 && a[7] - max2 == a[8] - max3) ? "Yes" : "No");
    }
} Main
public class Main {
    private static java.util.Scanner scanner = new java.util.Scanner(System.in);

    public static void main(String[] args) {
        int max1 = 100, max2 = 100, max3 = 100, a[] = new int[9];
        for (int i = 0; i < 3; i++) {
            max1 = Math.min(max1, a[i * 3] = scanner.nextInt());
            max2 = Math.min(max2, a[i * 3 + 1] = scanner.nextInt());
            max3 = Math.min(max3, a[i * 3 + 2] = scanner.nextInt());
        }

        System.out.println((a[0] - max1 == a[1] - max2 && a[1] - max2 == a[2] - max3) &&
                (a[3] - max1 == a[4] - max2 && a[4] - max2 == a[5] - max3) &&
                (a[6] - max1 == a[7] - max2 && a[7] - max2 == a[8] - max3) ? "Yes" : "No");
    }
}