import java.util.*;

public class Main {
    public static void run(int C[][]) {
        int r[] = new int[3];

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                int d = C[i][j] - C[i][j == 2 ? 0 : j + 1];
                if (i == 0) {
                    r[j] = d;
                } else if (d != r[j]) {
                    System.out.println("No");
                    return;
                }
            }
        }

        for (int j = 0; j < 3; j++) {
            for (int i = 0; i < 3; i++) {
                int d = C[i][j] - C[i == 2 ? 0 : i + 1][j];
                if (j == 0) {
                    r[i] = d;
                } else if (d != r[i]) {
                    System.out.println("No");
                    return;
                }
            }
        }

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

    public static void runInput() {
        Scanner scanner = 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] = scanner.nextInt();
            }
        }

        run(C);
    }

    public static void main(String args[]) {
        runInput();

    }
} import java.util.*; util.* java public class Main {
    public static void run(int C[][]) {
        int r[] = new int[3];

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                int d = C[i][j] - C[i][j == 2 ? 0 : j + 1];
                if (i == 0) {
                    r[j] = d;
                } else if (d != r[j]) {
                    System.out.println("No");
                    return;
                }
            }
        }

        for (int j = 0; j < 3; j++) {
            for (int i = 0; i < 3; i++) {
                int d = C[i][j] - C[i == 2 ? 0 : i + 1][j];
                if (j == 0) {
                    r[i] = d;
                } else if (d != r[i]) {
                    System.out.println("No");
                    return;
                }
            }
        }

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

    public static void runInput() {
        Scanner scanner = 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] = scanner.nextInt();
            }
        }

        run(C);
    }

    public static void main(String args[]) {
        runInput();

    }
} Main public static void run(int C[][]) {
        int r[] = new int[3];

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                int d = C[i][j] - C[i][j == 2 ? 0 : j + 1];
                if (i == 0) {
                    r[j] = d;
                } else if (d != r[j]) {
                    System.out.println("No");
                    return;
                }
            }
        }

        for (int j = 0; j < 3; j++) {
            for (int i = 0; i < 3; i++) {
                int d = C[i][j] - C[i == 2 ? 0 : i + 1][j];
                if (j == 0) {
                    r[i] = d;
                } else if (d != r[i]) {
                    System.out.println("No");
                    return;
                }
            }
        }

        System.out.println("Yes");
    } run {
        int r[] = new int[3];

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                int d = C[i][j] - C[i][j == 2 ? 0 : j + 1];
                if (i == 0) {
                    r[j] = d;
                } else if (d != r[j]) {
                    System.out.println("No");
                    return;
                }
            }
        }

        for (int j = 0; j < 3; j++) {
            for (int i = 0; i < 3; i++) {
                int d = C[i][j] - C[i == 2 ? 0 : i + 1][j];
                if (j == 0) {
                    r[i] = d;
                } else if (d != r[i]) {
                    System.out.println("No");
                    return;
                }
            }
        }

        System.out.println("Yes");
    } int r[] = new int[3]; r new int[3] 3 for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                int d = C[i][j] - C[i][j == 2 ? 0 : j + 1];
                if (i == 0) {
                    r[j] = d;
                } else if (d != r[j]) {
                    System.out.println("No");
                    return;
                }
            }
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            for (int j = 0; j < 3; j++) {
                int d = C[i][j] - C[i][j == 2 ? 0 : j + 1];
                if (i == 0) {
                    r[j] = d;
                } else if (d != r[j]) {
                    System.out.println("No");
                    return;
                }
            }
        } {
            for (int j = 0; j < 3; j++) {
                int d = C[i][j] - C[i][j == 2 ? 0 : j + 1];
                if (i == 0) {
                    r[j] = d;
                } else if (d != r[j]) {
                    System.out.println("No");
                    return;
                }
            }
        } for (int j = 0; j < 3; j++) {
                int d = C[i][j] - C[i][j == 2 ? 0 : j + 1];
                if (i == 0) {
                    r[j] = d;
                } else if (d != r[j]) {
                    System.out.println("No");
                    return;
                }
            } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
                int d = C[i][j] - C[i][j == 2 ? 0 : j + 1];
                if (i == 0) {
                    r[j] = d;
                } else if (d != r[j]) {
                    System.out.println("No");
                    return;
                }
            } {
                int d = C[i][j] - C[i][j == 2 ? 0 : j + 1];
                if (i == 0) {
                    r[j] = d;
                } else if (d != r[j]) {
                    System.out.println("No");
                    return;
                }
            } int d = C[i][j] - C[i][j == 2 ? 0 : j + 1]; d C[i][j] - C[i][j == 2 ? 0 : j + 1] C[i][j] C[i] C i j C[i][j == 2 ? 0 : j + 1] C[i] C i j == 2 ? 0 : j + 1 j == 2 j 2 0 j + 1 j 1 if (i == 0) {
                    r[j] = d;
                } else if (d != r[j]) {
                    System.out.println("No");
                    return;
                } i == 0 i 0 {
                    r[j] = d;
                } r[j] = d r[j] r j d if (d != r[j]) {
                    System.out.println("No");
                    return;
                } d != r[j] d r[j] r j {
                    System.out.println("No");
                    return;
                } System.out.println("No") System.out.println System.out System System.out "No" return; for (int j = 0; j < 3; j++) {
            for (int i = 0; i < 3; i++) {
                int d = C[i][j] - C[i == 2 ? 0 : i + 1][j];
                if (j == 0) {
                    r[i] = d;
                } else if (d != r[i]) {
                    System.out.println("No");
                    return;
                }
            }
        } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
            for (int i = 0; i < 3; i++) {
                int d = C[i][j] - C[i == 2 ? 0 : i + 1][j];
                if (j == 0) {
                    r[i] = d;
                } else if (d != r[i]) {
                    System.out.println("No");
                    return;
                }
            }
        } {
            for (int i = 0; i < 3; i++) {
                int d = C[i][j] - C[i == 2 ? 0 : i + 1][j];
                if (j == 0) {
                    r[i] = d;
                } else if (d != r[i]) {
                    System.out.println("No");
                    return;
                }
            }
        } for (int i = 0; i < 3; i++) {
                int d = C[i][j] - C[i == 2 ? 0 : i + 1][j];
                if (j == 0) {
                    r[i] = d;
                } else if (d != r[i]) {
                    System.out.println("No");
                    return;
                }
            } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
                int d = C[i][j] - C[i == 2 ? 0 : i + 1][j];
                if (j == 0) {
                    r[i] = d;
                } else if (d != r[i]) {
                    System.out.println("No");
                    return;
                }
            } {
                int d = C[i][j] - C[i == 2 ? 0 : i + 1][j];
                if (j == 0) {
                    r[i] = d;
                } else if (d != r[i]) {
                    System.out.println("No");
                    return;
                }
            } int d = C[i][j] - C[i == 2 ? 0 : i + 1][j]; d C[i][j] - C[i == 2 ? 0 : i + 1][j] C[i][j] C[i] C i j C[i == 2 ? 0 : i + 1][j] C[i == 2 ? 0 : i + 1] C i == 2 ? 0 : i + 1 i == 2 i 2 0 i + 1 i 1 j if (j == 0) {
                    r[i] = d;
                } else if (d != r[i]) {
                    System.out.println("No");
                    return;
                } j == 0 j 0 {
                    r[i] = d;
                } r[i] = d r[i] r i d if (d != r[i]) {
                    System.out.println("No");
                    return;
                } d != r[i] d r[i] r 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" int C[][] C public static void runInput() {
        Scanner scanner = 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] = scanner.nextInt();
            }
        }

        run(C);
    } runInput {
        Scanner scanner = 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] = scanner.nextInt();
            }
        }

        run(C);
    } 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++) {
            for (int j = 0; j < 3; j++) {
                C[i][j] = scanner.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] = scanner.nextInt();
            }
        } {
            for (int j = 0; j < 3; j++) {
                C[i][j] = scanner.nextInt();
            }
        } for (int j = 0; j < 3; j++) {
                C[i][j] = scanner.nextInt();
            } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
                C[i][j] = scanner.nextInt();
            } {
                C[i][j] = scanner.nextInt();
            } C[i][j] = scanner.nextInt() C[i][j] C[i] C i j scanner.nextInt() scanner.nextInt scanner run(C) run C public static void main(String args[]) {
        runInput();

    } main {
        runInput();

    } runInput() runInput String args[] args public class Main {
    public static void run(int C[][]) {
        int r[] = new int[3];

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                int d = C[i][j] - C[i][j == 2 ? 0 : j + 1];
                if (i == 0) {
                    r[j] = d;
                } else if (d != r[j]) {
                    System.out.println("No");
                    return;
                }
            }
        }

        for (int j = 0; j < 3; j++) {
            for (int i = 0; i < 3; i++) {
                int d = C[i][j] - C[i == 2 ? 0 : i + 1][j];
                if (j == 0) {
                    r[i] = d;
                } else if (d != r[i]) {
                    System.out.println("No");
                    return;
                }
            }
        }

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

    public static void runInput() {
        Scanner scanner = 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] = scanner.nextInt();
            }
        }

        run(C);
    }

    public static void main(String args[]) {
        runInput();

    }
} public class Main {
    public static void run(int C[][]) {
        int r[] = new int[3];

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                int d = C[i][j] - C[i][j == 2 ? 0 : j + 1];
                if (i == 0) {
                    r[j] = d;
                } else if (d != r[j]) {
                    System.out.println("No");
                    return;
                }
            }
        }

        for (int j = 0; j < 3; j++) {
            for (int i = 0; i < 3; i++) {
                int d = C[i][j] - C[i == 2 ? 0 : i + 1][j];
                if (j == 0) {
                    r[i] = d;
                } else if (d != r[i]) {
                    System.out.println("No");
                    return;
                }
            }
        }

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

    public static void runInput() {
        Scanner scanner = 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] = scanner.nextInt();
            }
        }

        run(C);
    }

    public static void main(String args[]) {
        runInput();

    }
} Main
import java.util.*;

public class Main {
    public static void run(int C[][]) {
        int r[] = new int[3];

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                int d = C[i][j] - C[i][j == 2 ? 0 : j + 1];
                if (i == 0) {
                    r[j] = d;
                } else if (d != r[j]) {
                    System.out.println("No");
                    return;
                }
            }
        }

        for (int j = 0; j < 3; j++) {
            for (int i = 0; i < 3; i++) {
                int d = C[i][j] - C[i == 2 ? 0 : i + 1][j];
                if (j == 0) {
                    r[i] = d;
                } else if (d != r[i]) {
                    System.out.println("No");
                    return;
                }
            }
        }

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

    public static void runInput() {
        Scanner scanner = 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] = scanner.nextInt();
            }
        }

        run(C);
    }

    public static void main(String args[]) {
        runInput();

    }
}
