import java.util.Scanner;

// C - Takahashi's Information
// https://atcoder.jp/contests/abc088/tasks/abc088_c
public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[][] c = new int[3][3];
        for (int i = 0; i < 3; i++) {
            c[i][0] = Integer.parseInt(scanner.next());
            c[i][1] = Integer.parseInt(scanner.next());
            c[i][2] = Integer.parseInt(scanner.next());
        }

        scanner.close();

        for (int i = 0; i < c.length; i++) {
            int min = Integer.MAX_VALUE;
            for (int j = 0; j < c[i].length; j++) {
                int num = c[i][j];
                if (min > num) {
                    min = num;
                }
            }

            // 全てにminを引く
            for (int j = 0; j < c[i].length; j++) {
                c[i][j] -= min;
            }
        }

        // 各列の値が同一であれば正しい、そうでなければ誤り
        for (int i = 0; i < c.length; i++) {
            if (c[0][i] != c[1][i] || c[1][i] != c[2][i]) {
                System.out.println("No");
                return;
            }
        }
        System.out.println("Yes");
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[][] c = new int[3][3];
        for (int i = 0; i < 3; i++) {
            c[i][0] = Integer.parseInt(scanner.next());
            c[i][1] = Integer.parseInt(scanner.next());
            c[i][2] = Integer.parseInt(scanner.next());
        }

        scanner.close();

        for (int i = 0; i < c.length; i++) {
            int min = Integer.MAX_VALUE;
            for (int j = 0; j < c[i].length; j++) {
                int num = c[i][j];
                if (min > num) {
                    min = num;
                }
            }

            // 全てにminを引く
            for (int j = 0; j < c[i].length; j++) {
                c[i][j] -= min;
            }
        }

        // 各列の値が同一であれば正しい、そうでなければ誤り
        for (int i = 0; i < c.length; i++) {
            if (c[0][i] != c[1][i] || c[1][i] != c[2][i]) {
                System.out.println("No");
                return;
            }
        }
        System.out.println("Yes");
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[][] c = new int[3][3];
        for (int i = 0; i < 3; i++) {
            c[i][0] = Integer.parseInt(scanner.next());
            c[i][1] = Integer.parseInt(scanner.next());
            c[i][2] = Integer.parseInt(scanner.next());
        }

        scanner.close();

        for (int i = 0; i < c.length; i++) {
            int min = Integer.MAX_VALUE;
            for (int j = 0; j < c[i].length; j++) {
                int num = c[i][j];
                if (min > num) {
                    min = num;
                }
            }

            // 全てにminを引く
            for (int j = 0; j < c[i].length; j++) {
                c[i][j] -= min;
            }
        }

        // 各列の値が同一であれば正しい、そうでなければ誤り
        for (int i = 0; i < c.length; i++) {
            if (c[0][i] != c[1][i] || c[1][i] != c[2][i]) {
                System.out.println("No");
                return;
            }
        }
        System.out.println("Yes");
    } main {
        Scanner scanner = new Scanner(System.in);
        int[][] c = new int[3][3];
        for (int i = 0; i < 3; i++) {
            c[i][0] = Integer.parseInt(scanner.next());
            c[i][1] = Integer.parseInt(scanner.next());
            c[i][2] = Integer.parseInt(scanner.next());
        }

        scanner.close();

        for (int i = 0; i < c.length; i++) {
            int min = Integer.MAX_VALUE;
            for (int j = 0; j < c[i].length; j++) {
                int num = c[i][j];
                if (min > num) {
                    min = num;
                }
            }

            // 全てにminを引く
            for (int j = 0; j < c[i].length; j++) {
                c[i][j] -= min;
            }
        }

        // 各列の値が同一であれば正しい、そうでなければ誤り
        for (int i = 0; i < c.length; i++) {
            if (c[0][i] != c[1][i] || c[1][i] != c[2][i]) {
                System.out.println("No");
                return;
            }
        }
        System.out.println("Yes");
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int[][] c = new int[3][3]; c new int[3][3] 3 3 for (int i = 0; i < 3; i++) {
            c[i][0] = Integer.parseInt(scanner.next());
            c[i][1] = Integer.parseInt(scanner.next());
            c[i][2] = Integer.parseInt(scanner.next());
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            c[i][0] = Integer.parseInt(scanner.next());
            c[i][1] = Integer.parseInt(scanner.next());
            c[i][2] = Integer.parseInt(scanner.next());
        } {
            c[i][0] = Integer.parseInt(scanner.next());
            c[i][1] = Integer.parseInt(scanner.next());
            c[i][2] = Integer.parseInt(scanner.next());
        } c[i][0] = Integer.parseInt(scanner.next()) c[i][0] c[i] c i 0 Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner c[i][1] = Integer.parseInt(scanner.next()) c[i][1] c[i] c i 1 Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner c[i][2] = Integer.parseInt(scanner.next()) c[i][2] c[i] c i 2 Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner scanner.close() scanner.close scanner for (int i = 0; i < c.length; i++) {
            int min = Integer.MAX_VALUE;
            for (int j = 0; j < c[i].length; j++) {
                int num = c[i][j];
                if (min > num) {
                    min = num;
                }
            }

            // 全てにminを引く
            for (int j = 0; j < c[i].length; j++) {
                c[i][j] -= min;
            }
        } int i = 0; int i = 0; i 0 i < c.length i c.length c c.length i++ i++ i {
            int min = Integer.MAX_VALUE;
            for (int j = 0; j < c[i].length; j++) {
                int num = c[i][j];
                if (min > num) {
                    min = num;
                }
            }

            // 全てにminを引く
            for (int j = 0; j < c[i].length; j++) {
                c[i][j] -= min;
            }
        } {
            int min = Integer.MAX_VALUE;
            for (int j = 0; j < c[i].length; j++) {
                int num = c[i][j];
                if (min > num) {
                    min = num;
                }
            }

            // 全てにminを引く
            for (int j = 0; j < c[i].length; j++) {
                c[i][j] -= min;
            }
        } int min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE for (int j = 0; j < c[i].length; j++) {
                int num = c[i][j];
                if (min > num) {
                    min = num;
                }
            } int j = 0; int j = 0; j 0 j < c[i].length j c[i].length c[i] c i c[i].length j++ j++ j {
                int num = c[i][j];
                if (min > num) {
                    min = num;
                }
            } {
                int num = c[i][j];
                if (min > num) {
                    min = num;
                }
            } int num = c[i][j]; num c[i][j] c[i] c i j if (min > num) {
                    min = num;
                } min > num min num {
                    min = num;
                } min = num min num for (int j = 0; j < c[i].length; j++) {
                c[i][j] -= min;
            } int j = 0; int j = 0; j 0 j < c[i].length j c[i].length c[i] c i c[i].length j++ j++ j {
                c[i][j] -= min;
            } {
                c[i][j] -= min;
            } c[i][j] -= min c[i][j] c[i] c i j min for (int i = 0; i < c.length; i++) {
            if (c[0][i] != c[1][i] || c[1][i] != c[2][i]) {
                System.out.println("No");
                return;
            }
        } int i = 0; int i = 0; i 0 i < c.length i c.length c c.length i++ i++ i {
            if (c[0][i] != c[1][i] || c[1][i] != c[2][i]) {
                System.out.println("No");
                return;
            }
        } {
            if (c[0][i] != c[1][i] || c[1][i] != c[2][i]) {
                System.out.println("No");
                return;
            }
        } if (c[0][i] != c[1][i] || c[1][i] != c[2][i]) {
                System.out.println("No");
                return;
            } c[0][i] != c[1][i] || c[1][i] != c[2][i] c[0][i] != c[1][i] c[0][i] c[0] c 0 i c[1][i] c[1] c 1 i c[1][i] != c[2][i] c[1][i] c[1] c 1 i c[2][i] c[2] c 2 i {
                System.out.println("No");
                return;
            } System.out.println("No") System.out.println System.out System System.out "No" return; System.out.println("Yes") System.out.println System.out System System.out "Yes" String[] args args public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[][] c = new int[3][3];
        for (int i = 0; i < 3; i++) {
            c[i][0] = Integer.parseInt(scanner.next());
            c[i][1] = Integer.parseInt(scanner.next());
            c[i][2] = Integer.parseInt(scanner.next());
        }

        scanner.close();

        for (int i = 0; i < c.length; i++) {
            int min = Integer.MAX_VALUE;
            for (int j = 0; j < c[i].length; j++) {
                int num = c[i][j];
                if (min > num) {
                    min = num;
                }
            }

            // 全てにminを引く
            for (int j = 0; j < c[i].length; j++) {
                c[i][j] -= min;
            }
        }

        // 各列の値が同一であれば正しい、そうでなければ誤り
        for (int i = 0; i < c.length; i++) {
            if (c[0][i] != c[1][i] || c[1][i] != c[2][i]) {
                System.out.println("No");
                return;
            }
        }
        System.out.println("Yes");
    }
} public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[][] c = new int[3][3];
        for (int i = 0; i < 3; i++) {
            c[i][0] = Integer.parseInt(scanner.next());
            c[i][1] = Integer.parseInt(scanner.next());
            c[i][2] = Integer.parseInt(scanner.next());
        }

        scanner.close();

        for (int i = 0; i < c.length; i++) {
            int min = Integer.MAX_VALUE;
            for (int j = 0; j < c[i].length; j++) {
                int num = c[i][j];
                if (min > num) {
                    min = num;
                }
            }

            // 全てにminを引く
            for (int j = 0; j < c[i].length; j++) {
                c[i][j] -= min;
            }
        }

        // 各列の値が同一であれば正しい、そうでなければ誤り
        for (int i = 0; i < c.length; i++) {
            if (c[0][i] != c[1][i] || c[1][i] != c[2][i]) {
                System.out.println("No");
                return;
            }
        }
        System.out.println("Yes");
    }
} Main
import java.util.Scanner;

// C - Takahashi's Information
// https://atcoder.jp/contests/abc088/tasks/abc088_c
public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[][] c = new int[3][3];
        for (int i = 0; i < 3; i++) {
            c[i][0] = Integer.parseInt(scanner.next());
            c[i][1] = Integer.parseInt(scanner.next());
            c[i][2] = Integer.parseInt(scanner.next());
        }

        scanner.close();

        for (int i = 0; i < c.length; i++) {
            int min = Integer.MAX_VALUE;
            for (int j = 0; j < c[i].length; j++) {
                int num = c[i][j];
                if (min > num) {
                    min = num;
                }
            }

            // 全てにminを引く
            for (int j = 0; j < c[i].length; j++) {
                c[i][j] -= min;
            }
        }

        // 各列の値が同一であれば正しい、そうでなければ誤り
        for (int i = 0; i < c.length; i++) {
            if (c[0][i] != c[1][i] || c[1][i] != c[2][i]) {
                System.out.println("No");
                return;
            }
        }
        System.out.println("Yes");
    }
}