import java.util.Scanner;

public class Main {
    public void main(Scanner sc) {
        int n[] = new int[9];
        for (int i = 0; i < 9; i++) {
            n[i] = sc.nextInt();
        }

        if (!check(n[0] - n[1], n[3] - n[4], n[6] - n[7])
            || !check(n[1] - n[2], n[4] - n[5], n[7] - n[8])
            || !check(n[0] - n[3], n[1] - n[4], n[2] - n[5])
            || !check(n[3] - n[6], n[4] - n[7], n[5] - n[8])) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        }

    }

    private boolean check(int sa1, int sa2, int sa3) {
        return (sa1 == sa2) && (sa2 == sa3) && (sa3 == sa1);
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        new Main().main(sc);
        sc.close();
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public void main(Scanner sc) {
        int n[] = new int[9];
        for (int i = 0; i < 9; i++) {
            n[i] = sc.nextInt();
        }

        if (!check(n[0] - n[1], n[3] - n[4], n[6] - n[7])
            || !check(n[1] - n[2], n[4] - n[5], n[7] - n[8])
            || !check(n[0] - n[3], n[1] - n[4], n[2] - n[5])
            || !check(n[3] - n[6], n[4] - n[7], n[5] - n[8])) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        }

    }

    private boolean check(int sa1, int sa2, int sa3) {
        return (sa1 == sa2) && (sa2 == sa3) && (sa3 == sa1);
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        new Main().main(sc);
        sc.close();
    }
} Main public void main(Scanner sc) {
        int n[] = new int[9];
        for (int i = 0; i < 9; i++) {
            n[i] = sc.nextInt();
        }

        if (!check(n[0] - n[1], n[3] - n[4], n[6] - n[7])
            || !check(n[1] - n[2], n[4] - n[5], n[7] - n[8])
            || !check(n[0] - n[3], n[1] - n[4], n[2] - n[5])
            || !check(n[3] - n[6], n[4] - n[7], n[5] - n[8])) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        }

    } main {
        int n[] = new int[9];
        for (int i = 0; i < 9; i++) {
            n[i] = sc.nextInt();
        }

        if (!check(n[0] - n[1], n[3] - n[4], n[6] - n[7])
            || !check(n[1] - n[2], n[4] - n[5], n[7] - n[8])
            || !check(n[0] - n[3], n[1] - n[4], n[2] - n[5])
            || !check(n[3] - n[6], n[4] - n[7], n[5] - n[8])) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        }

    } int n[] = new int[9]; n new int[9] 9 for (int i = 0; i < 9; i++) {
            n[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < 9 i 9 i++ i++ i {
            n[i] = sc.nextInt();
        } {
            n[i] = sc.nextInt();
        } n[i] = sc.nextInt() n[i] n i sc.nextInt() sc.nextInt sc if (!check(n[0] - n[1], n[3] - n[4], n[6] - n[7])
            || !check(n[1] - n[2], n[4] - n[5], n[7] - n[8])
            || !check(n[0] - n[3], n[1] - n[4], n[2] - n[5])
            || !check(n[3] - n[6], n[4] - n[7], n[5] - n[8])) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        } !check(n[0] - n[1], n[3] - n[4], n[6] - n[7])
            || !check(n[1] - n[2], n[4] - n[5], n[7] - n[8])
            || !check(n[0] - n[3], n[1] - n[4], n[2] - n[5])
            || !check(n[3] - n[6], n[4] - n[7], n[5] - n[8]) !check(n[0] - n[3], n[1] - n[4], n[2] - n[5]) !check(n[0] - n[1], n[3] - n[4], n[6] - n[7])
            || !check(n[1] - n[2], n[4] - n[5], n[7] - n[8])
            || !check(n[0] - n[3], n[1] - n[4], n[2] - n[5])
            || !check(n[3] - n[6], n[4] - n[7], n[5] - n[8]) !check(n[0] - n[1], n[3] - n[4], n[6] - n[7]) check(n[0] - n[1], n[3] - n[4], n[6] - n[7]) check n[0] - n[1] n[0] n 0 n[1] n 1 n[3] - n[4] n[3] n 3 n[4] n 4 n[6] - n[7] n[6] n 6 n[7] n 7 !check(n[1] - n[2], n[4] - n[5], n[7] - n[8]) check(n[1] - n[2], n[4] - n[5], n[7] - n[8]) check n[1] - n[2] n[1] n 1 n[2] n 2 n[4] - n[5] n[4] n 4 n[5] n 5 n[7] - n[8] n[7] n 7 n[8] n 8 !check(n[0] - n[3], n[1] - n[4], n[2] - n[5]) check(n[0] - n[3], n[1] - n[4], n[2] - n[5]) check n[0] - n[3] n[0] n 0 n[3] n 3 n[1] - n[4] n[1] n 1 n[4] n 4 n[2] - n[5] n[2] n 2 n[5] n 5 !check(n[3] - n[6], n[4] - n[7], n[5] - n[8]) check(n[3] - n[6], n[4] - n[7], n[5] - n[8]) check n[3] - n[6] n[3] n 3 n[6] n 6 n[4] - n[7] n[4] n 4 n[7] n 7 n[5] - n[8] n[5] n 5 n[8] n 8 {
            System.out.println("No");
        } System.out.println("No") System.out.println System.out System System.out "No" {
            System.out.println("Yes");
        } System.out.println("Yes") System.out.println System.out System System.out "Yes" Scanner sc sc private boolean check(int sa1, int sa2, int sa3) {
        return (sa1 == sa2) && (sa2 == sa3) && (sa3 == sa1);
    } check {
        return (sa1 == sa2) && (sa2 == sa3) && (sa3 == sa1);
    } return (sa1 == sa2) && (sa2 == sa3) && (sa3 == sa1); (sa1 == sa2) && (sa2 == sa3) && (sa3 == sa1) (sa1 == sa2) && (sa2 == sa3) && (sa3 == sa1) (sa1 == sa2) sa1 sa2 (sa2 == sa3) sa2 sa3 (sa3 == sa1) sa3 sa1 int sa1 sa1 int sa2 sa2 int sa3 sa3 public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        new Main().main(sc);
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        new Main().main(sc);
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) new Main().main(sc) new Main().main new Main() sc sc.close() sc.close sc String[] args args public class Main {
    public void main(Scanner sc) {
        int n[] = new int[9];
        for (int i = 0; i < 9; i++) {
            n[i] = sc.nextInt();
        }

        if (!check(n[0] - n[1], n[3] - n[4], n[6] - n[7])
            || !check(n[1] - n[2], n[4] - n[5], n[7] - n[8])
            || !check(n[0] - n[3], n[1] - n[4], n[2] - n[5])
            || !check(n[3] - n[6], n[4] - n[7], n[5] - n[8])) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        }

    }

    private boolean check(int sa1, int sa2, int sa3) {
        return (sa1 == sa2) && (sa2 == sa3) && (sa3 == sa1);
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        new Main().main(sc);
        sc.close();
    }
} public class Main {
    public void main(Scanner sc) {
        int n[] = new int[9];
        for (int i = 0; i < 9; i++) {
            n[i] = sc.nextInt();
        }

        if (!check(n[0] - n[1], n[3] - n[4], n[6] - n[7])
            || !check(n[1] - n[2], n[4] - n[5], n[7] - n[8])
            || !check(n[0] - n[3], n[1] - n[4], n[2] - n[5])
            || !check(n[3] - n[6], n[4] - n[7], n[5] - n[8])) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        }

    }

    private boolean check(int sa1, int sa2, int sa3) {
        return (sa1 == sa2) && (sa2 == sa3) && (sa3 == sa1);
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        new Main().main(sc);
        sc.close();
    }
} Main
import java.util.Scanner;

public class Main {
    public void main(Scanner sc) {
        int n[] = new int[9];
        for (int i = 0; i < 9; i++) {
            n[i] = sc.nextInt();
        }

        if (!check(n[0] - n[1], n[3] - n[4], n[6] - n[7])
            || !check(n[1] - n[2], n[4] - n[5], n[7] - n[8])
            || !check(n[0] - n[3], n[1] - n[4], n[2] - n[5])
            || !check(n[3] - n[6], n[4] - n[7], n[5] - n[8])) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        }

    }

    private boolean check(int sa1, int sa2, int sa3) {
        return (sa1 == sa2) && (sa2 == sa3) && (sa3 == sa1);
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        new Main().main(sc);
        sc.close();
    }
}
