import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int[][] C = new int[3][3];
            for (int r = 0; r < 3; r++) {
                for (int c = 0; c < 3; c++) {
                    C[r][c] = in.nextInt();
                }
            }

            int[] a = new int[3];
            int[] b = new int[3];
            int[][] a2 = new int[3][3];
            a[0] = 0;

            for (int c = 0; c < 3; c++) {
                b[c] = C[0][c] - a[0];
            }

            for (int r = 0; r < 3; r++) {
                for (int c = 0; c < 3; c++) {
                    a2[r][c] = C[r][c] - b[c];
                }
            }

            for (int r = 0; r < 3; r++) {
                for (int c = 1; c < 3; c++) {
                    if (a2[r][c - 1] != a2[r][c]) {
                        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) {
        try (Scanner in = new Scanner(System.in)) {
            int[][] C = new int[3][3];
            for (int r = 0; r < 3; r++) {
                for (int c = 0; c < 3; c++) {
                    C[r][c] = in.nextInt();
                }
            }

            int[] a = new int[3];
            int[] b = new int[3];
            int[][] a2 = new int[3][3];
            a[0] = 0;

            for (int c = 0; c < 3; c++) {
                b[c] = C[0][c] - a[0];
            }

            for (int r = 0; r < 3; r++) {
                for (int c = 0; c < 3; c++) {
                    a2[r][c] = C[r][c] - b[c];
                }
            }

            for (int r = 0; r < 3; r++) {
                for (int c = 1; c < 3; c++) {
                    if (a2[r][c - 1] != a2[r][c]) {
                        System.out.println("No");
                        return;
                    }
                }
            }
            System.out.println("Yes");
        }
    }
} Main public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int[][] C = new int[3][3];
            for (int r = 0; r < 3; r++) {
                for (int c = 0; c < 3; c++) {
                    C[r][c] = in.nextInt();
                }
            }

            int[] a = new int[3];
            int[] b = new int[3];
            int[][] a2 = new int[3][3];
            a[0] = 0;

            for (int c = 0; c < 3; c++) {
                b[c] = C[0][c] - a[0];
            }

            for (int r = 0; r < 3; r++) {
                for (int c = 0; c < 3; c++) {
                    a2[r][c] = C[r][c] - b[c];
                }
            }

            for (int r = 0; r < 3; r++) {
                for (int c = 1; c < 3; c++) {
                    if (a2[r][c - 1] != a2[r][c]) {
                        System.out.println("No");
                        return;
                    }
                }
            }
            System.out.println("Yes");
        }
    } main {
        try (Scanner in = new Scanner(System.in)) {
            int[][] C = new int[3][3];
            for (int r = 0; r < 3; r++) {
                for (int c = 0; c < 3; c++) {
                    C[r][c] = in.nextInt();
                }
            }

            int[] a = new int[3];
            int[] b = new int[3];
            int[][] a2 = new int[3][3];
            a[0] = 0;

            for (int c = 0; c < 3; c++) {
                b[c] = C[0][c] - a[0];
            }

            for (int r = 0; r < 3; r++) {
                for (int c = 0; c < 3; c++) {
                    a2[r][c] = C[r][c] - b[c];
                }
            }

            for (int r = 0; r < 3; r++) {
                for (int c = 1; c < 3; c++) {
                    if (a2[r][c - 1] != a2[r][c]) {
                        System.out.println("No");
                        return;
                    }
                }
            }
            System.out.println("Yes");
        }
    } try (Scanner in = new Scanner(System.in)) {
            int[][] C = new int[3][3];
            for (int r = 0; r < 3; r++) {
                for (int c = 0; c < 3; c++) {
                    C[r][c] = in.nextInt();
                }
            }

            int[] a = new int[3];
            int[] b = new int[3];
            int[][] a2 = new int[3][3];
            a[0] = 0;

            for (int c = 0; c < 3; c++) {
                b[c] = C[0][c] - a[0];
            }

            for (int r = 0; r < 3; r++) {
                for (int c = 0; c < 3; c++) {
                    a2[r][c] = C[r][c] - b[c];
                }
            }

            for (int r = 0; r < 3; r++) {
                for (int c = 1; c < 3; c++) {
                    if (a2[r][c - 1] != a2[r][c]) {
                        System.out.println("No");
                        return;
                    }
                }
            }
            System.out.println("Yes");
        } {
            int[][] C = new int[3][3];
            for (int r = 0; r < 3; r++) {
                for (int c = 0; c < 3; c++) {
                    C[r][c] = in.nextInt();
                }
            }

            int[] a = new int[3];
            int[] b = new int[3];
            int[][] a2 = new int[3][3];
            a[0] = 0;

            for (int c = 0; c < 3; c++) {
                b[c] = C[0][c] - a[0];
            }

            for (int r = 0; r < 3; r++) {
                for (int c = 0; c < 3; c++) {
                    a2[r][c] = C[r][c] - b[c];
                }
            }

            for (int r = 0; r < 3; r++) {
                for (int c = 1; c < 3; c++) {
                    if (a2[r][c - 1] != a2[r][c]) {
                        System.out.println("No");
                        return;
                    }
                }
            }
            System.out.println("Yes");
        } Scanner in = new Scanner(System.in) Scanner in = new Scanner(System.in) new Scanner(System.in) int[][] C = new int[3][3]; C new int[3][3] 3 3 for (int r = 0; r < 3; r++) {
                for (int c = 0; c < 3; c++) {
                    C[r][c] = in.nextInt();
                }
            } int r = 0; int r = 0; r 0 r < 3 r 3 r++ r++ r {
                for (int c = 0; c < 3; c++) {
                    C[r][c] = in.nextInt();
                }
            } {
                for (int c = 0; c < 3; c++) {
                    C[r][c] = in.nextInt();
                }
            } for (int c = 0; c < 3; c++) {
                    C[r][c] = in.nextInt();
                } int c = 0; int c = 0; c 0 c < 3 c 3 c++ c++ c {
                    C[r][c] = in.nextInt();
                } {
                    C[r][c] = in.nextInt();
                } C[r][c] = in.nextInt() C[r][c] C[r] C r c in.nextInt() in.nextInt in int[] a = new int[3]; a new int[3] 3 int[] b = new int[3]; b new int[3] 3 int[][] a2 = new int[3][3]; a2 new int[3][3] 3 3 a[0] = 0 a[0] a 0 0 for (int c = 0; c < 3; c++) {
                b[c] = C[0][c] - a[0];
            } int c = 0; int c = 0; c 0 c < 3 c 3 c++ c++ c {
                b[c] = C[0][c] - a[0];
            } {
                b[c] = C[0][c] - a[0];
            } b[c] = C[0][c] - a[0] b[c] b c C[0][c] - a[0] C[0][c] C[0] C 0 c a[0] a 0 for (int r = 0; r < 3; r++) {
                for (int c = 0; c < 3; c++) {
                    a2[r][c] = C[r][c] - b[c];
                }
            } int r = 0; int r = 0; r 0 r < 3 r 3 r++ r++ r {
                for (int c = 0; c < 3; c++) {
                    a2[r][c] = C[r][c] - b[c];
                }
            } {
                for (int c = 0; c < 3; c++) {
                    a2[r][c] = C[r][c] - b[c];
                }
            } for (int c = 0; c < 3; c++) {
                    a2[r][c] = C[r][c] - b[c];
                } int c = 0; int c = 0; c 0 c < 3 c 3 c++ c++ c {
                    a2[r][c] = C[r][c] - b[c];
                } {
                    a2[r][c] = C[r][c] - b[c];
                } a2[r][c] = C[r][c] - b[c] a2[r][c] a2[r] a2 r c C[r][c] - b[c] C[r][c] C[r] C r c b[c] b c for (int r = 0; r < 3; r++) {
                for (int c = 1; c < 3; c++) {
                    if (a2[r][c - 1] != a2[r][c]) {
                        System.out.println("No");
                        return;
                    }
                }
            } int r = 0; int r = 0; r 0 r < 3 r 3 r++ r++ r {
                for (int c = 1; c < 3; c++) {
                    if (a2[r][c - 1] != a2[r][c]) {
                        System.out.println("No");
                        return;
                    }
                }
            } {
                for (int c = 1; c < 3; c++) {
                    if (a2[r][c - 1] != a2[r][c]) {
                        System.out.println("No");
                        return;
                    }
                }
            } for (int c = 1; c < 3; c++) {
                    if (a2[r][c - 1] != a2[r][c]) {
                        System.out.println("No");
                        return;
                    }
                } int c = 1; int c = 1; c 1 c < 3 c 3 c++ c++ c {
                    if (a2[r][c - 1] != a2[r][c]) {
                        System.out.println("No");
                        return;
                    }
                } {
                    if (a2[r][c - 1] != a2[r][c]) {
                        System.out.println("No");
                        return;
                    }
                } if (a2[r][c - 1] != a2[r][c]) {
                        System.out.println("No");
                        return;
                    } a2[r][c - 1] != a2[r][c] a2[r][c - 1] a2[r] a2 r c - 1 c 1 a2[r][c] a2[r] a2 r c {
                        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) {
        try (Scanner in = new Scanner(System.in)) {
            int[][] C = new int[3][3];
            for (int r = 0; r < 3; r++) {
                for (int c = 0; c < 3; c++) {
                    C[r][c] = in.nextInt();
                }
            }

            int[] a = new int[3];
            int[] b = new int[3];
            int[][] a2 = new int[3][3];
            a[0] = 0;

            for (int c = 0; c < 3; c++) {
                b[c] = C[0][c] - a[0];
            }

            for (int r = 0; r < 3; r++) {
                for (int c = 0; c < 3; c++) {
                    a2[r][c] = C[r][c] - b[c];
                }
            }

            for (int r = 0; r < 3; r++) {
                for (int c = 1; c < 3; c++) {
                    if (a2[r][c - 1] != a2[r][c]) {
                        System.out.println("No");
                        return;
                    }
                }
            }
            System.out.println("Yes");
        }
    }
} public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int[][] C = new int[3][3];
            for (int r = 0; r < 3; r++) {
                for (int c = 0; c < 3; c++) {
                    C[r][c] = in.nextInt();
                }
            }

            int[] a = new int[3];
            int[] b = new int[3];
            int[][] a2 = new int[3][3];
            a[0] = 0;

            for (int c = 0; c < 3; c++) {
                b[c] = C[0][c] - a[0];
            }

            for (int r = 0; r < 3; r++) {
                for (int c = 0; c < 3; c++) {
                    a2[r][c] = C[r][c] - b[c];
                }
            }

            for (int r = 0; r < 3; r++) {
                for (int c = 1; c < 3; c++) {
                    if (a2[r][c - 1] != a2[r][c]) {
                        System.out.println("No");
                        return;
                    }
                }
            }
            System.out.println("Yes");
        }
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int[][] C = new int[3][3];
            for (int r = 0; r < 3; r++) {
                for (int c = 0; c < 3; c++) {
                    C[r][c] = in.nextInt();
                }
            }

            int[] a = new int[3];
            int[] b = new int[3];
            int[][] a2 = new int[3][3];
            a[0] = 0;

            for (int c = 0; c < 3; c++) {
                b[c] = C[0][c] - a[0];
            }

            for (int r = 0; r < 3; r++) {
                for (int c = 0; c < 3; c++) {
                    a2[r][c] = C[r][c] - b[c];
                }
            }

            for (int r = 0; r < 3; r++) {
                for (int c = 1; c < 3; c++) {
                    if (a2[r][c - 1] != a2[r][c]) {
                        System.out.println("No");
                        return;
                    }
                }
            }
            System.out.println("Yes");
        }
    }
}
