import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int c[][] = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c[i][j] = sc.nextInt();
            }
        }
        boolean ans = true;
        for (int i = 0; i < 2; i++) {
            int left = c[i + 1][0] - c[i][0];
            int center = c[i + 1][1] - c[i][1];
            int right = c[i + 1][2] - c[i][2];
            if (left != center || center != right || right != left) {
                ans = false;
            }
        }
        for (int j = 0; j < 2; j++) {
            int up = c[0][j + 1] - c[0][j];
            int center = c[1][j + 1] - c[1][j];
            int down = c[2][j + 1] - c[2][j];
            if (up != down || up != center || down != center) {
                ans = false;
            }
        }
        if (ans) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int c[][] = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c[i][j] = sc.nextInt();
            }
        }
        boolean ans = true;
        for (int i = 0; i < 2; i++) {
            int left = c[i + 1][0] - c[i][0];
            int center = c[i + 1][1] - c[i][1];
            int right = c[i + 1][2] - c[i][2];
            if (left != center || center != right || right != left) {
                ans = false;
            }
        }
        for (int j = 0; j < 2; j++) {
            int up = c[0][j + 1] - c[0][j];
            int center = c[1][j + 1] - c[1][j];
            int down = c[2][j + 1] - c[2][j];
            if (up != down || up != center || down != center) {
                ans = false;
            }
        }
        if (ans) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int c[][] = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c[i][j] = sc.nextInt();
            }
        }
        boolean ans = true;
        for (int i = 0; i < 2; i++) {
            int left = c[i + 1][0] - c[i][0];
            int center = c[i + 1][1] - c[i][1];
            int right = c[i + 1][2] - c[i][2];
            if (left != center || center != right || right != left) {
                ans = false;
            }
        }
        for (int j = 0; j < 2; j++) {
            int up = c[0][j + 1] - c[0][j];
            int center = c[1][j + 1] - c[1][j];
            int down = c[2][j + 1] - c[2][j];
            if (up != down || up != center || down != center) {
                ans = false;
            }
        }
        if (ans) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int c[][] = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c[i][j] = sc.nextInt();
            }
        }
        boolean ans = true;
        for (int i = 0; i < 2; i++) {
            int left = c[i + 1][0] - c[i][0];
            int center = c[i + 1][1] - c[i][1];
            int right = c[i + 1][2] - c[i][2];
            if (left != center || center != right || right != left) {
                ans = false;
            }
        }
        for (int j = 0; j < 2; j++) {
            int up = c[0][j + 1] - c[0][j];
            int center = c[1][j + 1] - c[1][j];
            int down = c[2][j + 1] - c[2][j];
            if (up != down || up != center || down != center) {
                ans = false;
            }
        }
        if (ans) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int c[][] = new int[3][3]; c new int[3][3] 3 3 for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c[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++) {
                c[i][j] = sc.nextInt();
            }
        } {
            for (int j = 0; j < 3; j++) {
                c[i][j] = sc.nextInt();
            }
        } for (int j = 0; j < 3; j++) {
                c[i][j] = sc.nextInt();
            } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
                c[i][j] = sc.nextInt();
            } {
                c[i][j] = sc.nextInt();
            } c[i][j] = sc.nextInt() c[i][j] c[i] c i j sc.nextInt() sc.nextInt sc boolean ans = true; ans true for (int i = 0; i < 2; i++) {
            int left = c[i + 1][0] - c[i][0];
            int center = c[i + 1][1] - c[i][1];
            int right = c[i + 1][2] - c[i][2];
            if (left != center || center != right || right != left) {
                ans = false;
            }
        } int i = 0; int i = 0; i 0 i < 2 i 2 i++ i++ i {
            int left = c[i + 1][0] - c[i][0];
            int center = c[i + 1][1] - c[i][1];
            int right = c[i + 1][2] - c[i][2];
            if (left != center || center != right || right != left) {
                ans = false;
            }
        } {
            int left = c[i + 1][0] - c[i][0];
            int center = c[i + 1][1] - c[i][1];
            int right = c[i + 1][2] - c[i][2];
            if (left != center || center != right || right != left) {
                ans = false;
            }
        } int left = c[i + 1][0] - c[i][0]; left c[i + 1][0] - c[i][0] c[i + 1][0] c[i + 1] c i + 1 i 1 0 c[i][0] c[i] c i 0 int center = c[i + 1][1] - c[i][1]; center c[i + 1][1] - c[i][1] c[i + 1][1] c[i + 1] c i + 1 i 1 1 c[i][1] c[i] c i 1 int right = c[i + 1][2] - c[i][2]; right c[i + 1][2] - c[i][2] c[i + 1][2] c[i + 1] c i + 1 i 1 2 c[i][2] c[i] c i 2 if (left != center || center != right || right != left) {
                ans = false;
            } left != center || center != right || right != left left != center || center != right || right != left left != center left center center != right center right right != left right left {
                ans = false;
            } ans = false ans false for (int j = 0; j < 2; j++) {
            int up = c[0][j + 1] - c[0][j];
            int center = c[1][j + 1] - c[1][j];
            int down = c[2][j + 1] - c[2][j];
            if (up != down || up != center || down != center) {
                ans = false;
            }
        } int j = 0; int j = 0; j 0 j < 2 j 2 j++ j++ j {
            int up = c[0][j + 1] - c[0][j];
            int center = c[1][j + 1] - c[1][j];
            int down = c[2][j + 1] - c[2][j];
            if (up != down || up != center || down != center) {
                ans = false;
            }
        } {
            int up = c[0][j + 1] - c[0][j];
            int center = c[1][j + 1] - c[1][j];
            int down = c[2][j + 1] - c[2][j];
            if (up != down || up != center || down != center) {
                ans = false;
            }
        } int up = c[0][j + 1] - c[0][j]; up c[0][j + 1] - c[0][j] c[0][j + 1] c[0] c 0 j + 1 j 1 c[0][j] c[0] c 0 j int center = c[1][j + 1] - c[1][j]; center c[1][j + 1] - c[1][j] c[1][j + 1] c[1] c 1 j + 1 j 1 c[1][j] c[1] c 1 j int down = c[2][j + 1] - c[2][j]; down c[2][j + 1] - c[2][j] c[2][j + 1] c[2] c 2 j + 1 j 1 c[2][j] c[2] c 2 j if (up != down || up != center || down != center) {
                ans = false;
            } up != down || up != center || down != center up != down || up != center || down != center up != down up down up != center up center down != center down center {
                ans = false;
            } ans = false ans false if (ans) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        } ans {
            System.out.println("Yes");
        } System.out.println("Yes") System.out.println System.out System System.out "Yes" {
            System.out.println("No");
        } System.out.println("No") System.out.println System.out System System.out "No" String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int c[][] = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c[i][j] = sc.nextInt();
            }
        }
        boolean ans = true;
        for (int i = 0; i < 2; i++) {
            int left = c[i + 1][0] - c[i][0];
            int center = c[i + 1][1] - c[i][1];
            int right = c[i + 1][2] - c[i][2];
            if (left != center || center != right || right != left) {
                ans = false;
            }
        }
        for (int j = 0; j < 2; j++) {
            int up = c[0][j + 1] - c[0][j];
            int center = c[1][j + 1] - c[1][j];
            int down = c[2][j + 1] - c[2][j];
            if (up != down || up != center || down != center) {
                ans = false;
            }
        }
        if (ans) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int c[][] = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c[i][j] = sc.nextInt();
            }
        }
        boolean ans = true;
        for (int i = 0; i < 2; i++) {
            int left = c[i + 1][0] - c[i][0];
            int center = c[i + 1][1] - c[i][1];
            int right = c[i + 1][2] - c[i][2];
            if (left != center || center != right || right != left) {
                ans = false;
            }
        }
        for (int j = 0; j < 2; j++) {
            int up = c[0][j + 1] - c[0][j];
            int center = c[1][j + 1] - c[1][j];
            int down = c[2][j + 1] - c[2][j];
            if (up != down || up != center || down != center) {
                ans = false;
            }
        }
        if (ans) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int c[][] = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c[i][j] = sc.nextInt();
            }
        }
        boolean ans = true;
        for (int i = 0; i < 2; i++) {
            int left = c[i + 1][0] - c[i][0];
            int center = c[i + 1][1] - c[i][1];
            int right = c[i + 1][2] - c[i][2];
            if (left != center || center != right || right != left) {
                ans = false;
            }
        }
        for (int j = 0; j < 2; j++) {
            int up = c[0][j + 1] - c[0][j];
            int center = c[1][j + 1] - c[1][j];
            int down = c[2][j + 1] - c[2][j];
            if (up != down || up != center || down != center) {
                ans = false;
            }
        }
        if (ans) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}