import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int[][] c1 = new int[3][3];
        int[][] c2 = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c1[i][j] = in.nextInt();
                c2[i][j] = c1[i][j];
            }
        }

        for (int i = 0; i < 3; i++) {
            c1[i][2] -= c1[i][0];
            c1[i][1] -= c1[i][0];
            c1[i][0] -= c1[i][0];
        }

        for (int j = 0; j < 3; j++) {
            if (!(c1[0][j] == c1[1][j] && c1[1][j] == c1[2][j])) {
                System.out.println("No");
                return;
            }
        }

        for (int i = 0; i < 3; i++) {
            c2[2][i] -= c2[0][i];
            c2[1][i] -= c2[0][i];
            c2[0][i] -= c2[0][i];
        }

        for (int j = 0; j < 3; j++) {
            if (!(c2[j][0] == c2[j][1] && c2[j][1] == c2[j][2])) {
                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 in = new Scanner(System.in);
        int[][] c1 = new int[3][3];
        int[][] c2 = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c1[i][j] = in.nextInt();
                c2[i][j] = c1[i][j];
            }
        }

        for (int i = 0; i < 3; i++) {
            c1[i][2] -= c1[i][0];
            c1[i][1] -= c1[i][0];
            c1[i][0] -= c1[i][0];
        }

        for (int j = 0; j < 3; j++) {
            if (!(c1[0][j] == c1[1][j] && c1[1][j] == c1[2][j])) {
                System.out.println("No");
                return;
            }
        }

        for (int i = 0; i < 3; i++) {
            c2[2][i] -= c2[0][i];
            c2[1][i] -= c2[0][i];
            c2[0][i] -= c2[0][i];
        }

        for (int j = 0; j < 3; j++) {
            if (!(c2[j][0] == c2[j][1] && c2[j][1] == c2[j][2])) {
                System.out.println("No");
                return;
            }
        }

        System.out.println("Yes");
    }
} Main public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int[][] c1 = new int[3][3];
        int[][] c2 = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c1[i][j] = in.nextInt();
                c2[i][j] = c1[i][j];
            }
        }

        for (int i = 0; i < 3; i++) {
            c1[i][2] -= c1[i][0];
            c1[i][1] -= c1[i][0];
            c1[i][0] -= c1[i][0];
        }

        for (int j = 0; j < 3; j++) {
            if (!(c1[0][j] == c1[1][j] && c1[1][j] == c1[2][j])) {
                System.out.println("No");
                return;
            }
        }

        for (int i = 0; i < 3; i++) {
            c2[2][i] -= c2[0][i];
            c2[1][i] -= c2[0][i];
            c2[0][i] -= c2[0][i];
        }

        for (int j = 0; j < 3; j++) {
            if (!(c2[j][0] == c2[j][1] && c2[j][1] == c2[j][2])) {
                System.out.println("No");
                return;
            }
        }

        System.out.println("Yes");
    } main {
        Scanner in = new Scanner(System.in);
        int[][] c1 = new int[3][3];
        int[][] c2 = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c1[i][j] = in.nextInt();
                c2[i][j] = c1[i][j];
            }
        }

        for (int i = 0; i < 3; i++) {
            c1[i][2] -= c1[i][0];
            c1[i][1] -= c1[i][0];
            c1[i][0] -= c1[i][0];
        }

        for (int j = 0; j < 3; j++) {
            if (!(c1[0][j] == c1[1][j] && c1[1][j] == c1[2][j])) {
                System.out.println("No");
                return;
            }
        }

        for (int i = 0; i < 3; i++) {
            c2[2][i] -= c2[0][i];
            c2[1][i] -= c2[0][i];
            c2[0][i] -= c2[0][i];
        }

        for (int j = 0; j < 3; j++) {
            if (!(c2[j][0] == c2[j][1] && c2[j][1] == c2[j][2])) {
                System.out.println("No");
                return;
            }
        }

        System.out.println("Yes");
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) int[][] c1 = new int[3][3]; c1 new int[3][3] 3 3 int[][] c2 = new int[3][3]; c2 new int[3][3] 3 3 for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c1[i][j] = in.nextInt();
                c2[i][j] = c1[i][j];
            }
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            for (int j = 0; j < 3; j++) {
                c1[i][j] = in.nextInt();
                c2[i][j] = c1[i][j];
            }
        } {
            for (int j = 0; j < 3; j++) {
                c1[i][j] = in.nextInt();
                c2[i][j] = c1[i][j];
            }
        } for (int j = 0; j < 3; j++) {
                c1[i][j] = in.nextInt();
                c2[i][j] = c1[i][j];
            } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
                c1[i][j] = in.nextInt();
                c2[i][j] = c1[i][j];
            } {
                c1[i][j] = in.nextInt();
                c2[i][j] = c1[i][j];
            } c1[i][j] = in.nextInt() c1[i][j] c1[i] c1 i j in.nextInt() in.nextInt in c2[i][j] = c1[i][j] c2[i][j] c2[i] c2 i j c1[i][j] c1[i] c1 i j for (int i = 0; i < 3; i++) {
            c1[i][2] -= c1[i][0];
            c1[i][1] -= c1[i][0];
            c1[i][0] -= c1[i][0];
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            c1[i][2] -= c1[i][0];
            c1[i][1] -= c1[i][0];
            c1[i][0] -= c1[i][0];
        } {
            c1[i][2] -= c1[i][0];
            c1[i][1] -= c1[i][0];
            c1[i][0] -= c1[i][0];
        } c1[i][2] -= c1[i][0] c1[i][2] c1[i] c1 i 2 c1[i][0] c1[i] c1 i 0 c1[i][1] -= c1[i][0] c1[i][1] c1[i] c1 i 1 c1[i][0] c1[i] c1 i 0 c1[i][0] -= c1[i][0] c1[i][0] c1[i] c1 i 0 c1[i][0] c1[i] c1 i 0 for (int j = 0; j < 3; j++) {
            if (!(c1[0][j] == c1[1][j] && c1[1][j] == c1[2][j])) {
                System.out.println("No");
                return;
            }
        } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
            if (!(c1[0][j] == c1[1][j] && c1[1][j] == c1[2][j])) {
                System.out.println("No");
                return;
            }
        } {
            if (!(c1[0][j] == c1[1][j] && c1[1][j] == c1[2][j])) {
                System.out.println("No");
                return;
            }
        } if (!(c1[0][j] == c1[1][j] && c1[1][j] == c1[2][j])) {
                System.out.println("No");
                return;
            } !(c1[0][j] == c1[1][j] && c1[1][j] == c1[2][j]) (c1[0][j] == c1[1][j] && c1[1][j] == c1[2][j]) c1[0][j] == c1[1][j] c1[0][j] c1[0] c1 0 j c1[1][j] c1[1] c1 1 j c1[1][j] == c1[2][j] c1[1][j] c1[1] c1 1 j c1[2][j] c1[2] c1 2 j {
                System.out.println("No");
                return;
            } System.out.println("No") System.out.println System.out System System.out "No" return; for (int i = 0; i < 3; i++) {
            c2[2][i] -= c2[0][i];
            c2[1][i] -= c2[0][i];
            c2[0][i] -= c2[0][i];
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            c2[2][i] -= c2[0][i];
            c2[1][i] -= c2[0][i];
            c2[0][i] -= c2[0][i];
        } {
            c2[2][i] -= c2[0][i];
            c2[1][i] -= c2[0][i];
            c2[0][i] -= c2[0][i];
        } c2[2][i] -= c2[0][i] c2[2][i] c2[2] c2 2 i c2[0][i] c2[0] c2 0 i c2[1][i] -= c2[0][i] c2[1][i] c2[1] c2 1 i c2[0][i] c2[0] c2 0 i c2[0][i] -= c2[0][i] c2[0][i] c2[0] c2 0 i c2[0][i] c2[0] c2 0 i for (int j = 0; j < 3; j++) {
            if (!(c2[j][0] == c2[j][1] && c2[j][1] == c2[j][2])) {
                System.out.println("No");
                return;
            }
        } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
            if (!(c2[j][0] == c2[j][1] && c2[j][1] == c2[j][2])) {
                System.out.println("No");
                return;
            }
        } {
            if (!(c2[j][0] == c2[j][1] && c2[j][1] == c2[j][2])) {
                System.out.println("No");
                return;
            }
        } if (!(c2[j][0] == c2[j][1] && c2[j][1] == c2[j][2])) {
                System.out.println("No");
                return;
            } !(c2[j][0] == c2[j][1] && c2[j][1] == c2[j][2]) (c2[j][0] == c2[j][1] && c2[j][1] == c2[j][2]) c2[j][0] == c2[j][1] c2[j][0] c2[j] c2 j 0 c2[j][1] c2[j] c2 j 1 c2[j][1] == c2[j][2] c2[j][1] c2[j] c2 j 1 c2[j][2] c2[j] c2 j 2 {
                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 in = new Scanner(System.in);
        int[][] c1 = new int[3][3];
        int[][] c2 = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c1[i][j] = in.nextInt();
                c2[i][j] = c1[i][j];
            }
        }

        for (int i = 0; i < 3; i++) {
            c1[i][2] -= c1[i][0];
            c1[i][1] -= c1[i][0];
            c1[i][0] -= c1[i][0];
        }

        for (int j = 0; j < 3; j++) {
            if (!(c1[0][j] == c1[1][j] && c1[1][j] == c1[2][j])) {
                System.out.println("No");
                return;
            }
        }

        for (int i = 0; i < 3; i++) {
            c2[2][i] -= c2[0][i];
            c2[1][i] -= c2[0][i];
            c2[0][i] -= c2[0][i];
        }

        for (int j = 0; j < 3; j++) {
            if (!(c2[j][0] == c2[j][1] && c2[j][1] == c2[j][2])) {
                System.out.println("No");
                return;
            }
        }

        System.out.println("Yes");
    }
} public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int[][] c1 = new int[3][3];
        int[][] c2 = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c1[i][j] = in.nextInt();
                c2[i][j] = c1[i][j];
            }
        }

        for (int i = 0; i < 3; i++) {
            c1[i][2] -= c1[i][0];
            c1[i][1] -= c1[i][0];
            c1[i][0] -= c1[i][0];
        }

        for (int j = 0; j < 3; j++) {
            if (!(c1[0][j] == c1[1][j] && c1[1][j] == c1[2][j])) {
                System.out.println("No");
                return;
            }
        }

        for (int i = 0; i < 3; i++) {
            c2[2][i] -= c2[0][i];
            c2[1][i] -= c2[0][i];
            c2[0][i] -= c2[0][i];
        }

        for (int j = 0; j < 3; j++) {
            if (!(c2[j][0] == c2[j][1] && c2[j][1] == c2[j][2])) {
                System.out.println("No");
                return;
            }
        }

        System.out.println("Yes");
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int[][] c1 = new int[3][3];
        int[][] c2 = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c1[i][j] = in.nextInt();
                c2[i][j] = c1[i][j];
            }
        }

        for (int i = 0; i < 3; i++) {
            c1[i][2] -= c1[i][0];
            c1[i][1] -= c1[i][0];
            c1[i][0] -= c1[i][0];
        }

        for (int j = 0; j < 3; j++) {
            if (!(c1[0][j] == c1[1][j] && c1[1][j] == c1[2][j])) {
                System.out.println("No");
                return;
            }
        }

        for (int i = 0; i < 3; i++) {
            c2[2][i] -= c2[0][i];
            c2[1][i] -= c2[0][i];
            c2[0][i] -= c2[0][i];
        }

        for (int j = 0; j < 3; j++) {
            if (!(c2[j][0] == c2[j][1] && c2[j][1] == c2[j][2])) {
                System.out.println("No");
                return;
            }
        }

        System.out.println("Yes");
    }
}