import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][] values = new int[3][3];

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                values[i][j] = sc.nextInt();
            }
        }

        boolean ok = false;
        for (int i = 0; i < 101; i++) { // a1
            for (int j = 0; j < 101; j++) { // a2
                for (int k = 0; k < 101; k++) { // a3
                    int b1 = values[0][0] - i;
                    int b2 = values[0][1] - i;
                    int b3 = values[0][2] - i;
                    if (b1 < 0 || b2 < 0 || b3 < 0) continue;
                    if ((values[1][0] == j + b1 && values[1][1] == j + b2 && values[1][2] == j + b3) &&
                            (values[2][0] == k + b1 && values[2][1] == k + b2 && values[2][2] == k + b3)) {
                        ok = true;
                    }
                }
            }
        }

        System.out.println(ok ? "Yes" : "No");
    }
} import java.util.*; util.* java class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][] values = new int[3][3];

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                values[i][j] = sc.nextInt();
            }
        }

        boolean ok = false;
        for (int i = 0; i < 101; i++) { // a1
            for (int j = 0; j < 101; j++) { // a2
                for (int k = 0; k < 101; k++) { // a3
                    int b1 = values[0][0] - i;
                    int b2 = values[0][1] - i;
                    int b3 = values[0][2] - i;
                    if (b1 < 0 || b2 < 0 || b3 < 0) continue;
                    if ((values[1][0] == j + b1 && values[1][1] == j + b2 && values[1][2] == j + b3) &&
                            (values[2][0] == k + b1 && values[2][1] == k + b2 && values[2][2] == k + b3)) {
                        ok = true;
                    }
                }
            }
        }

        System.out.println(ok ? "Yes" : "No");
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][] values = new int[3][3];

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                values[i][j] = sc.nextInt();
            }
        }

        boolean ok = false;
        for (int i = 0; i < 101; i++) { // a1
            for (int j = 0; j < 101; j++) { // a2
                for (int k = 0; k < 101; k++) { // a3
                    int b1 = values[0][0] - i;
                    int b2 = values[0][1] - i;
                    int b3 = values[0][2] - i;
                    if (b1 < 0 || b2 < 0 || b3 < 0) continue;
                    if ((values[1][0] == j + b1 && values[1][1] == j + b2 && values[1][2] == j + b3) &&
                            (values[2][0] == k + b1 && values[2][1] == k + b2 && values[2][2] == k + b3)) {
                        ok = true;
                    }
                }
            }
        }

        System.out.println(ok ? "Yes" : "No");
    } main {
        Scanner sc = new Scanner(System.in);
        int[][] values = new int[3][3];

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                values[i][j] = sc.nextInt();
            }
        }

        boolean ok = false;
        for (int i = 0; i < 101; i++) { // a1
            for (int j = 0; j < 101; j++) { // a2
                for (int k = 0; k < 101; k++) { // a3
                    int b1 = values[0][0] - i;
                    int b2 = values[0][1] - i;
                    int b3 = values[0][2] - i;
                    if (b1 < 0 || b2 < 0 || b3 < 0) continue;
                    if ((values[1][0] == j + b1 && values[1][1] == j + b2 && values[1][2] == j + b3) &&
                            (values[2][0] == k + b1 && values[2][1] == k + b2 && values[2][2] == k + b3)) {
                        ok = true;
                    }
                }
            }
        }

        System.out.println(ok ? "Yes" : "No");
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[][] values = new int[3][3]; values new int[3][3] 3 3 for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                values[i][j] = sc.nextInt();
            }
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            for (int j = 0; j < 3; j++) {
                values[i][j] = sc.nextInt();
            }
        } {
            for (int j = 0; j < 3; j++) {
                values[i][j] = sc.nextInt();
            }
        } for (int j = 0; j < 3; j++) {
                values[i][j] = sc.nextInt();
            } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
                values[i][j] = sc.nextInt();
            } {
                values[i][j] = sc.nextInt();
            } values[i][j] = sc.nextInt() values[i][j] values[i] values i j sc.nextInt() sc.nextInt sc boolean ok = false; ok false for (int i = 0; i < 101; i++) { // a1
            for (int j = 0; j < 101; j++) { // a2
                for (int k = 0; k < 101; k++) { // a3
                    int b1 = values[0][0] - i;
                    int b2 = values[0][1] - i;
                    int b3 = values[0][2] - i;
                    if (b1 < 0 || b2 < 0 || b3 < 0) continue;
                    if ((values[1][0] == j + b1 && values[1][1] == j + b2 && values[1][2] == j + b3) &&
                            (values[2][0] == k + b1 && values[2][1] == k + b2 && values[2][2] == k + b3)) {
                        ok = true;
                    }
                }
            }
        } int i = 0; int i = 0; i 0 i < 101 i 101 i++ i++ i { // a1
            for (int j = 0; j < 101; j++) { // a2
                for (int k = 0; k < 101; k++) { // a3
                    int b1 = values[0][0] - i;
                    int b2 = values[0][1] - i;
                    int b3 = values[0][2] - i;
                    if (b1 < 0 || b2 < 0 || b3 < 0) continue;
                    if ((values[1][0] == j + b1 && values[1][1] == j + b2 && values[1][2] == j + b3) &&
                            (values[2][0] == k + b1 && values[2][1] == k + b2 && values[2][2] == k + b3)) {
                        ok = true;
                    }
                }
            }
        } { // a1
            for (int j = 0; j < 101; j++) { // a2
                for (int k = 0; k < 101; k++) { // a3
                    int b1 = values[0][0] - i;
                    int b2 = values[0][1] - i;
                    int b3 = values[0][2] - i;
                    if (b1 < 0 || b2 < 0 || b3 < 0) continue;
                    if ((values[1][0] == j + b1 && values[1][1] == j + b2 && values[1][2] == j + b3) &&
                            (values[2][0] == k + b1 && values[2][1] == k + b2 && values[2][2] == k + b3)) {
                        ok = true;
                    }
                }
            }
        } for (int j = 0; j < 101; j++) { // a2
                for (int k = 0; k < 101; k++) { // a3
                    int b1 = values[0][0] - i;
                    int b2 = values[0][1] - i;
                    int b3 = values[0][2] - i;
                    if (b1 < 0 || b2 < 0 || b3 < 0) continue;
                    if ((values[1][0] == j + b1 && values[1][1] == j + b2 && values[1][2] == j + b3) &&
                            (values[2][0] == k + b1 && values[2][1] == k + b2 && values[2][2] == k + b3)) {
                        ok = true;
                    }
                }
            } int j = 0; int j = 0; j 0 j < 101 j 101 j++ j++ j { // a2
                for (int k = 0; k < 101; k++) { // a3
                    int b1 = values[0][0] - i;
                    int b2 = values[0][1] - i;
                    int b3 = values[0][2] - i;
                    if (b1 < 0 || b2 < 0 || b3 < 0) continue;
                    if ((values[1][0] == j + b1 && values[1][1] == j + b2 && values[1][2] == j + b3) &&
                            (values[2][0] == k + b1 && values[2][1] == k + b2 && values[2][2] == k + b3)) {
                        ok = true;
                    }
                }
            } { // a2
                for (int k = 0; k < 101; k++) { // a3
                    int b1 = values[0][0] - i;
                    int b2 = values[0][1] - i;
                    int b3 = values[0][2] - i;
                    if (b1 < 0 || b2 < 0 || b3 < 0) continue;
                    if ((values[1][0] == j + b1 && values[1][1] == j + b2 && values[1][2] == j + b3) &&
                            (values[2][0] == k + b1 && values[2][1] == k + b2 && values[2][2] == k + b3)) {
                        ok = true;
                    }
                }
            } for (int k = 0; k < 101; k++) { // a3
                    int b1 = values[0][0] - i;
                    int b2 = values[0][1] - i;
                    int b3 = values[0][2] - i;
                    if (b1 < 0 || b2 < 0 || b3 < 0) continue;
                    if ((values[1][0] == j + b1 && values[1][1] == j + b2 && values[1][2] == j + b3) &&
                            (values[2][0] == k + b1 && values[2][1] == k + b2 && values[2][2] == k + b3)) {
                        ok = true;
                    }
                } int k = 0; int k = 0; k 0 k < 101 k 101 k++ k++ k { // a3
                    int b1 = values[0][0] - i;
                    int b2 = values[0][1] - i;
                    int b3 = values[0][2] - i;
                    if (b1 < 0 || b2 < 0 || b3 < 0) continue;
                    if ((values[1][0] == j + b1 && values[1][1] == j + b2 && values[1][2] == j + b3) &&
                            (values[2][0] == k + b1 && values[2][1] == k + b2 && values[2][2] == k + b3)) {
                        ok = true;
                    }
                } { // a3
                    int b1 = values[0][0] - i;
                    int b2 = values[0][1] - i;
                    int b3 = values[0][2] - i;
                    if (b1 < 0 || b2 < 0 || b3 < 0) continue;
                    if ((values[1][0] == j + b1 && values[1][1] == j + b2 && values[1][2] == j + b3) &&
                            (values[2][0] == k + b1 && values[2][1] == k + b2 && values[2][2] == k + b3)) {
                        ok = true;
                    }
                } int b1 = values[0][0] - i; b1 values[0][0] - i values[0][0] values[0] values 0 0 i int b2 = values[0][1] - i; b2 values[0][1] - i values[0][1] values[0] values 0 1 i int b3 = values[0][2] - i; b3 values[0][2] - i values[0][2] values[0] values 0 2 i if (b1 < 0 || b2 < 0 || b3 < 0) continue; b1 < 0 || b2 < 0 || b3 < 0 b1 < 0 || b2 < 0 || b3 < 0 b1 < 0 b1 0 b2 < 0 b2 0 b3 < 0 b3 0 continue; if ((values[1][0] == j + b1 && values[1][1] == j + b2 && values[1][2] == j + b3) &&
                            (values[2][0] == k + b1 && values[2][1] == k + b2 && values[2][2] == k + b3)) {
                        ok = true;
                    } (values[1][0] == j + b1 && values[1][1] == j + b2 && values[1][2] == j + b3) &&
                            (values[2][0] == k + b1 && values[2][1] == k + b2 && values[2][2] == k + b3) (values[1][0] == j + b1 && values[1][1] == j + b2 && values[1][2] == j + b3) values[1][0] == j + b1 && values[1][1] == j + b2 && values[1][2] == j + b3 values[1][0] == j + b1 values[1][0] values[1] values 1 0 j + b1 j b1 values[1][1] == j + b2 values[1][1] values[1] values 1 1 j + b2 j b2 values[1][2] == j + b3 values[1][2] values[1] values 1 2 j + b3 j b3 (values[2][0] == k + b1 && values[2][1] == k + b2 && values[2][2] == k + b3) values[2][0] == k + b1 && values[2][1] == k + b2 && values[2][2] == k + b3 values[2][0] == k + b1 values[2][0] values[2] values 2 0 k + b1 k b1 values[2][1] == k + b2 values[2][1] values[2] values 2 1 k + b2 k b2 values[2][2] == k + b3 values[2][2] values[2] values 2 2 k + b3 k b3 {
                        ok = true;
                    } ok = true ok true System.out.println(ok ? "Yes" : "No") System.out.println System.out System System.out ok ? "Yes" : "No" ok "Yes" "No" String[] args args
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][] values = new int[3][3];

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                values[i][j] = sc.nextInt();
            }
        }

        boolean ok = false;
        for (int i = 0; i < 101; i++) { // a1
            for (int j = 0; j < 101; j++) { // a2
                for (int k = 0; k < 101; k++) { // a3
                    int b1 = values[0][0] - i;
                    int b2 = values[0][1] - i;
                    int b3 = values[0][2] - i;
                    if (b1 < 0 || b2 < 0 || b3 < 0) continue;
                    if ((values[1][0] == j + b1 && values[1][1] == j + b2 && values[1][2] == j + b3) &&
                            (values[2][0] == k + b1 && values[2][1] == k + b2 && values[2][2] == k + b3)) {
                        ok = true;
                    }
                }
            }
        }

        System.out.println(ok ? "Yes" : "No");
    }
}