import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int[][] map = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                map[i][j] = scan.nextInt();
            }
        }
        boolean found = true;
        // a1-a2
        if (map[0][0] - map[1][0] != map[0][1] - map[1][1] || map[0][1] - map[1][1] != map[0][2] - map[1][2]) {
            found = false;
        }
        // a2-a3
        if (map[1][0] - map[2][0] != map[1][1] - map[2][1] || map[1][1] - map[2][1] != map[1][2] - map[2][2]) {
            found = false;
        }
        // a3-a1
        if (map[2][0] - map[0][0] != map[2][1] - map[0][1] || map[2][1] - map[0][1] != map[2][2] - map[0][2]) {
            found = false;
        }
        // b1-b2
        if (map[0][0] - map[0][1] != map[1][0] - map[1][1] || map[1][0] - map[1][1] != map[2][0] - map[2][1]) {
            found = false;
        }
        // b2-b3
        if (map[0][1] - map[0][2] != map[1][1] - map[1][2] || map[1][1] - map[1][2] != map[2][1] - map[2][2]) {
            found = false;
        }
        // b3-b1
        if (map[2][2] - map[2][0] != map[1][2] - map[1][0] || map[1][2] - map[1][0] != map[0][2] - map[0][0]) {
            found = false;
        }
        System.out.println(found ? "Yes" : "No");
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Arrays; Arrays java.util import java.util.Comparator; Comparator java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int[][] map = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                map[i][j] = scan.nextInt();
            }
        }
        boolean found = true;
        // a1-a2
        if (map[0][0] - map[1][0] != map[0][1] - map[1][1] || map[0][1] - map[1][1] != map[0][2] - map[1][2]) {
            found = false;
        }
        // a2-a3
        if (map[1][0] - map[2][0] != map[1][1] - map[2][1] || map[1][1] - map[2][1] != map[1][2] - map[2][2]) {
            found = false;
        }
        // a3-a1
        if (map[2][0] - map[0][0] != map[2][1] - map[0][1] || map[2][1] - map[0][1] != map[2][2] - map[0][2]) {
            found = false;
        }
        // b1-b2
        if (map[0][0] - map[0][1] != map[1][0] - map[1][1] || map[1][0] - map[1][1] != map[2][0] - map[2][1]) {
            found = false;
        }
        // b2-b3
        if (map[0][1] - map[0][2] != map[1][1] - map[1][2] || map[1][1] - map[1][2] != map[2][1] - map[2][2]) {
            found = false;
        }
        // b3-b1
        if (map[2][2] - map[2][0] != map[1][2] - map[1][0] || map[1][2] - map[1][0] != map[0][2] - map[0][0]) {
            found = false;
        }
        System.out.println(found ? "Yes" : "No");
    }
} Main public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    } main {
        Main main = new Main();
        main.solve();
    } Main main = new Main(); main new Main() main.solve() main.solve main String[] args args public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int[][] map = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                map[i][j] = scan.nextInt();
            }
        }
        boolean found = true;
        // a1-a2
        if (map[0][0] - map[1][0] != map[0][1] - map[1][1] || map[0][1] - map[1][1] != map[0][2] - map[1][2]) {
            found = false;
        }
        // a2-a3
        if (map[1][0] - map[2][0] != map[1][1] - map[2][1] || map[1][1] - map[2][1] != map[1][2] - map[2][2]) {
            found = false;
        }
        // a3-a1
        if (map[2][0] - map[0][0] != map[2][1] - map[0][1] || map[2][1] - map[0][1] != map[2][2] - map[0][2]) {
            found = false;
        }
        // b1-b2
        if (map[0][0] - map[0][1] != map[1][0] - map[1][1] || map[1][0] - map[1][1] != map[2][0] - map[2][1]) {
            found = false;
        }
        // b2-b3
        if (map[0][1] - map[0][2] != map[1][1] - map[1][2] || map[1][1] - map[1][2] != map[2][1] - map[2][2]) {
            found = false;
        }
        // b3-b1
        if (map[2][2] - map[2][0] != map[1][2] - map[1][0] || map[1][2] - map[1][0] != map[0][2] - map[0][0]) {
            found = false;
        }
        System.out.println(found ? "Yes" : "No");
    } solve {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int[][] map = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                map[i][j] = scan.nextInt();
            }
        }
        boolean found = true;
        // a1-a2
        if (map[0][0] - map[1][0] != map[0][1] - map[1][1] || map[0][1] - map[1][1] != map[0][2] - map[1][2]) {
            found = false;
        }
        // a2-a3
        if (map[1][0] - map[2][0] != map[1][1] - map[2][1] || map[1][1] - map[2][1] != map[1][2] - map[2][2]) {
            found = false;
        }
        // a3-a1
        if (map[2][0] - map[0][0] != map[2][1] - map[0][1] || map[2][1] - map[0][1] != map[2][2] - map[0][2]) {
            found = false;
        }
        // b1-b2
        if (map[0][0] - map[0][1] != map[1][0] - map[1][1] || map[1][0] - map[1][1] != map[2][0] - map[2][1]) {
            found = false;
        }
        // b2-b3
        if (map[0][1] - map[0][2] != map[1][1] - map[1][2] || map[1][1] - map[1][2] != map[2][1] - map[2][2]) {
            found = false;
        }
        // b3-b1
        if (map[2][2] - map[2][0] != map[1][2] - map[1][0] || map[1][2] - map[1][0] != map[0][2] - map[0][0]) {
            found = false;
        }
        System.out.println(found ? "Yes" : "No");
    } Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in))); scan new Scanner(new BufferedReader(new InputStreamReader(System.in))) int[][] map = new int[3][3]; map new int[3][3] 3 3 for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                map[i][j] = scan.nextInt();
            }
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            for (int j = 0; j < 3; j++) {
                map[i][j] = scan.nextInt();
            }
        } {
            for (int j = 0; j < 3; j++) {
                map[i][j] = scan.nextInt();
            }
        } for (int j = 0; j < 3; j++) {
                map[i][j] = scan.nextInt();
            } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
                map[i][j] = scan.nextInt();
            } {
                map[i][j] = scan.nextInt();
            } map[i][j] = scan.nextInt() map[i][j] map[i] map i j scan.nextInt() scan.nextInt scan boolean found = true; found true if (map[0][0] - map[1][0] != map[0][1] - map[1][1] || map[0][1] - map[1][1] != map[0][2] - map[1][2]) {
            found = false;
        } map[0][0] - map[1][0] != map[0][1] - map[1][1] || map[0][1] - map[1][1] != map[0][2] - map[1][2] map[0][0] - map[1][0] != map[0][1] - map[1][1] map[0][0] - map[1][0] map[0][0] map[0] map 0 0 map[1][0] map[1] map 1 0 map[0][1] - map[1][1] map[0][1] map[0] map 0 1 map[1][1] map[1] map 1 1 map[0][1] - map[1][1] != map[0][2] - map[1][2] map[0][1] - map[1][1] map[0][1] map[0] map 0 1 map[1][1] map[1] map 1 1 map[0][2] - map[1][2] map[0][2] map[0] map 0 2 map[1][2] map[1] map 1 2 {
            found = false;
        } found = false found false if (map[1][0] - map[2][0] != map[1][1] - map[2][1] || map[1][1] - map[2][1] != map[1][2] - map[2][2]) {
            found = false;
        } map[1][0] - map[2][0] != map[1][1] - map[2][1] || map[1][1] - map[2][1] != map[1][2] - map[2][2] map[1][0] - map[2][0] != map[1][1] - map[2][1] map[1][0] - map[2][0] map[1][0] map[1] map 1 0 map[2][0] map[2] map 2 0 map[1][1] - map[2][1] map[1][1] map[1] map 1 1 map[2][1] map[2] map 2 1 map[1][1] - map[2][1] != map[1][2] - map[2][2] map[1][1] - map[2][1] map[1][1] map[1] map 1 1 map[2][1] map[2] map 2 1 map[1][2] - map[2][2] map[1][2] map[1] map 1 2 map[2][2] map[2] map 2 2 {
            found = false;
        } found = false found false if (map[2][0] - map[0][0] != map[2][1] - map[0][1] || map[2][1] - map[0][1] != map[2][2] - map[0][2]) {
            found = false;
        } map[2][0] - map[0][0] != map[2][1] - map[0][1] || map[2][1] - map[0][1] != map[2][2] - map[0][2] map[2][0] - map[0][0] != map[2][1] - map[0][1] map[2][0] - map[0][0] map[2][0] map[2] map 2 0 map[0][0] map[0] map 0 0 map[2][1] - map[0][1] map[2][1] map[2] map 2 1 map[0][1] map[0] map 0 1 map[2][1] - map[0][1] != map[2][2] - map[0][2] map[2][1] - map[0][1] map[2][1] map[2] map 2 1 map[0][1] map[0] map 0 1 map[2][2] - map[0][2] map[2][2] map[2] map 2 2 map[0][2] map[0] map 0 2 {
            found = false;
        } found = false found false if (map[0][0] - map[0][1] != map[1][0] - map[1][1] || map[1][0] - map[1][1] != map[2][0] - map[2][1]) {
            found = false;
        } map[0][0] - map[0][1] != map[1][0] - map[1][1] || map[1][0] - map[1][1] != map[2][0] - map[2][1] map[0][0] - map[0][1] != map[1][0] - map[1][1] map[0][0] - map[0][1] map[0][0] map[0] map 0 0 map[0][1] map[0] map 0 1 map[1][0] - map[1][1] map[1][0] map[1] map 1 0 map[1][1] map[1] map 1 1 map[1][0] - map[1][1] != map[2][0] - map[2][1] map[1][0] - map[1][1] map[1][0] map[1] map 1 0 map[1][1] map[1] map 1 1 map[2][0] - map[2][1] map[2][0] map[2] map 2 0 map[2][1] map[2] map 2 1 {
            found = false;
        } found = false found false if (map[0][1] - map[0][2] != map[1][1] - map[1][2] || map[1][1] - map[1][2] != map[2][1] - map[2][2]) {
            found = false;
        } map[0][1] - map[0][2] != map[1][1] - map[1][2] || map[1][1] - map[1][2] != map[2][1] - map[2][2] map[0][1] - map[0][2] != map[1][1] - map[1][2] map[0][1] - map[0][2] map[0][1] map[0] map 0 1 map[0][2] map[0] map 0 2 map[1][1] - map[1][2] map[1][1] map[1] map 1 1 map[1][2] map[1] map 1 2 map[1][1] - map[1][2] != map[2][1] - map[2][2] map[1][1] - map[1][2] map[1][1] map[1] map 1 1 map[1][2] map[1] map 1 2 map[2][1] - map[2][2] map[2][1] map[2] map 2 1 map[2][2] map[2] map 2 2 {
            found = false;
        } found = false found false if (map[2][2] - map[2][0] != map[1][2] - map[1][0] || map[1][2] - map[1][0] != map[0][2] - map[0][0]) {
            found = false;
        } map[2][2] - map[2][0] != map[1][2] - map[1][0] || map[1][2] - map[1][0] != map[0][2] - map[0][0] map[2][2] - map[2][0] != map[1][2] - map[1][0] map[2][2] - map[2][0] map[2][2] map[2] map 2 2 map[2][0] map[2] map 2 0 map[1][2] - map[1][0] map[1][2] map[1] map 1 2 map[1][0] map[1] map 1 0 map[1][2] - map[1][0] != map[0][2] - map[0][0] map[1][2] - map[1][0] map[1][2] map[1] map 1 2 map[1][0] map[1] map 1 0 map[0][2] - map[0][0] map[0][2] map[0] map 0 2 map[0][0] map[0] map 0 0 {
            found = false;
        } found = false found false System.out.println(found ? "Yes" : "No") System.out.println System.out System System.out found ? "Yes" : "No" found "Yes" "No" public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int[][] map = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                map[i][j] = scan.nextInt();
            }
        }
        boolean found = true;
        // a1-a2
        if (map[0][0] - map[1][0] != map[0][1] - map[1][1] || map[0][1] - map[1][1] != map[0][2] - map[1][2]) {
            found = false;
        }
        // a2-a3
        if (map[1][0] - map[2][0] != map[1][1] - map[2][1] || map[1][1] - map[2][1] != map[1][2] - map[2][2]) {
            found = false;
        }
        // a3-a1
        if (map[2][0] - map[0][0] != map[2][1] - map[0][1] || map[2][1] - map[0][1] != map[2][2] - map[0][2]) {
            found = false;
        }
        // b1-b2
        if (map[0][0] - map[0][1] != map[1][0] - map[1][1] || map[1][0] - map[1][1] != map[2][0] - map[2][1]) {
            found = false;
        }
        // b2-b3
        if (map[0][1] - map[0][2] != map[1][1] - map[1][2] || map[1][1] - map[1][2] != map[2][1] - map[2][2]) {
            found = false;
        }
        // b3-b1
        if (map[2][2] - map[2][0] != map[1][2] - map[1][0] || map[1][2] - map[1][0] != map[0][2] - map[0][0]) {
            found = false;
        }
        System.out.println(found ? "Yes" : "No");
    }
} public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int[][] map = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                map[i][j] = scan.nextInt();
            }
        }
        boolean found = true;
        // a1-a2
        if (map[0][0] - map[1][0] != map[0][1] - map[1][1] || map[0][1] - map[1][1] != map[0][2] - map[1][2]) {
            found = false;
        }
        // a2-a3
        if (map[1][0] - map[2][0] != map[1][1] - map[2][1] || map[1][1] - map[2][1] != map[1][2] - map[2][2]) {
            found = false;
        }
        // a3-a1
        if (map[2][0] - map[0][0] != map[2][1] - map[0][1] || map[2][1] - map[0][1] != map[2][2] - map[0][2]) {
            found = false;
        }
        // b1-b2
        if (map[0][0] - map[0][1] != map[1][0] - map[1][1] || map[1][0] - map[1][1] != map[2][0] - map[2][1]) {
            found = false;
        }
        // b2-b3
        if (map[0][1] - map[0][2] != map[1][1] - map[1][2] || map[1][1] - map[1][2] != map[2][1] - map[2][2]) {
            found = false;
        }
        // b3-b1
        if (map[2][2] - map[2][0] != map[1][2] - map[1][0] || map[1][2] - map[1][0] != map[0][2] - map[0][0]) {
            found = false;
        }
        System.out.println(found ? "Yes" : "No");
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int[][] map = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                map[i][j] = scan.nextInt();
            }
        }
        boolean found = true;
        // a1-a2
        if (map[0][0] - map[1][0] != map[0][1] - map[1][1] || map[0][1] - map[1][1] != map[0][2] - map[1][2]) {
            found = false;
        }
        // a2-a3
        if (map[1][0] - map[2][0] != map[1][1] - map[2][1] || map[1][1] - map[2][1] != map[1][2] - map[2][2]) {
            found = false;
        }
        // a3-a1
        if (map[2][0] - map[0][0] != map[2][1] - map[0][1] || map[2][1] - map[0][1] != map[2][2] - map[0][2]) {
            found = false;
        }
        // b1-b2
        if (map[0][0] - map[0][1] != map[1][0] - map[1][1] || map[1][0] - map[1][1] != map[2][0] - map[2][1]) {
            found = false;
        }
        // b2-b3
        if (map[0][1] - map[0][2] != map[1][1] - map[1][2] || map[1][1] - map[1][2] != map[2][1] - map[2][2]) {
            found = false;
        }
        // b3-b1
        if (map[2][2] - map[2][0] != map[1][2] - map[1][0] || map[1][2] - map[1][0] != map[0][2] - map[0][0]) {
            found = false;
        }
        System.out.println(found ? "Yes" : "No");
    }
}
