import java.util.*;
class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][] a = new int[3][3];
        for(int i = 0; i<3; i++) {
            for(int j = 0; j<3; j++) {
                a[i][j] = sc.nextInt();
            }
        }

        for(int i = 0; i<=100; i++) {
            for(int j = 0; j<=100; j++) {
                for(int k = 0; k<=100; k++) {
                    if(a[0][0]-i ==  a[1][0] - j && a[1][0]-j ==  a[2][0] - k && a[2][0]-k ==  a[0][0] - i) {
                        if(a[0][1]-i ==  a[1][1] - j && a[1][1]-j ==  a[2][1] - k && a[2][1]-k ==  a[0][1] - i) {
                            if(a[0][2]-i ==  a[1][2] - j && a[1][2]-j ==  a[2][2] - k && a[2][2]-k ==  a[0][2] - i) {
                                System.out.println("Yes");
                                return;
                            }
                        }
                    }
                }
            }
        }
        System.out.println("No");

    }
} import java.util.*; util.* java class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][] a = new int[3][3];
        for(int i = 0; i<3; i++) {
            for(int j = 0; j<3; j++) {
                a[i][j] = sc.nextInt();
            }
        }

        for(int i = 0; i<=100; i++) {
            for(int j = 0; j<=100; j++) {
                for(int k = 0; k<=100; k++) {
                    if(a[0][0]-i ==  a[1][0] - j && a[1][0]-j ==  a[2][0] - k && a[2][0]-k ==  a[0][0] - i) {
                        if(a[0][1]-i ==  a[1][1] - j && a[1][1]-j ==  a[2][1] - k && a[2][1]-k ==  a[0][1] - i) {
                            if(a[0][2]-i ==  a[1][2] - j && a[1][2]-j ==  a[2][2] - k && a[2][2]-k ==  a[0][2] - i) {
                                System.out.println("Yes");
                                return;
                            }
                        }
                    }
                }
            }
        }
        System.out.println("No");

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

        for(int i = 0; i<=100; i++) {
            for(int j = 0; j<=100; j++) {
                for(int k = 0; k<=100; k++) {
                    if(a[0][0]-i ==  a[1][0] - j && a[1][0]-j ==  a[2][0] - k && a[2][0]-k ==  a[0][0] - i) {
                        if(a[0][1]-i ==  a[1][1] - j && a[1][1]-j ==  a[2][1] - k && a[2][1]-k ==  a[0][1] - i) {
                            if(a[0][2]-i ==  a[1][2] - j && a[1][2]-j ==  a[2][2] - k && a[2][2]-k ==  a[0][2] - i) {
                                System.out.println("Yes");
                                return;
                            }
                        }
                    }
                }
            }
        }
        System.out.println("No");

    } main {
        Scanner sc = new Scanner(System.in);
        int[][] a = new int[3][3];
        for(int i = 0; i<3; i++) {
            for(int j = 0; j<3; j++) {
                a[i][j] = sc.nextInt();
            }
        }

        for(int i = 0; i<=100; i++) {
            for(int j = 0; j<=100; j++) {
                for(int k = 0; k<=100; k++) {
                    if(a[0][0]-i ==  a[1][0] - j && a[1][0]-j ==  a[2][0] - k && a[2][0]-k ==  a[0][0] - i) {
                        if(a[0][1]-i ==  a[1][1] - j && a[1][1]-j ==  a[2][1] - k && a[2][1]-k ==  a[0][1] - i) {
                            if(a[0][2]-i ==  a[1][2] - j && a[1][2]-j ==  a[2][2] - k && a[2][2]-k ==  a[0][2] - i) {
                                System.out.println("Yes");
                                return;
                            }
                        }
                    }
                }
            }
        }
        System.out.println("No");

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[][] a = new int[3][3]; a new int[3][3] 3 3 for(int i = 0; i<3; i++) {
            for(int j = 0; j<3; j++) {
                a[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++) {
                a[i][j] = sc.nextInt();
            }
        } {
            for(int j = 0; j<3; j++) {
                a[i][j] = sc.nextInt();
            }
        } for(int j = 0; j<3; j++) {
                a[i][j] = sc.nextInt();
            } int j = 0; int j = 0; j 0 j<3 j 3 j++ j++ j {
                a[i][j] = sc.nextInt();
            } {
                a[i][j] = sc.nextInt();
            } a[i][j] = sc.nextInt() a[i][j] a[i] a i j sc.nextInt() sc.nextInt sc for(int i = 0; i<=100; i++) {
            for(int j = 0; j<=100; j++) {
                for(int k = 0; k<=100; k++) {
                    if(a[0][0]-i ==  a[1][0] - j && a[1][0]-j ==  a[2][0] - k && a[2][0]-k ==  a[0][0] - i) {
                        if(a[0][1]-i ==  a[1][1] - j && a[1][1]-j ==  a[2][1] - k && a[2][1]-k ==  a[0][1] - i) {
                            if(a[0][2]-i ==  a[1][2] - j && a[1][2]-j ==  a[2][2] - k && a[2][2]-k ==  a[0][2] - i) {
                                System.out.println("Yes");
                                return;
                            }
                        }
                    }
                }
            }
        } int i = 0; int i = 0; i 0 i<=100 i 100 i++ i++ i {
            for(int j = 0; j<=100; j++) {
                for(int k = 0; k<=100; k++) {
                    if(a[0][0]-i ==  a[1][0] - j && a[1][0]-j ==  a[2][0] - k && a[2][0]-k ==  a[0][0] - i) {
                        if(a[0][1]-i ==  a[1][1] - j && a[1][1]-j ==  a[2][1] - k && a[2][1]-k ==  a[0][1] - i) {
                            if(a[0][2]-i ==  a[1][2] - j && a[1][2]-j ==  a[2][2] - k && a[2][2]-k ==  a[0][2] - i) {
                                System.out.println("Yes");
                                return;
                            }
                        }
                    }
                }
            }
        } {
            for(int j = 0; j<=100; j++) {
                for(int k = 0; k<=100; k++) {
                    if(a[0][0]-i ==  a[1][0] - j && a[1][0]-j ==  a[2][0] - k && a[2][0]-k ==  a[0][0] - i) {
                        if(a[0][1]-i ==  a[1][1] - j && a[1][1]-j ==  a[2][1] - k && a[2][1]-k ==  a[0][1] - i) {
                            if(a[0][2]-i ==  a[1][2] - j && a[1][2]-j ==  a[2][2] - k && a[2][2]-k ==  a[0][2] - i) {
                                System.out.println("Yes");
                                return;
                            }
                        }
                    }
                }
            }
        } for(int j = 0; j<=100; j++) {
                for(int k = 0; k<=100; k++) {
                    if(a[0][0]-i ==  a[1][0] - j && a[1][0]-j ==  a[2][0] - k && a[2][0]-k ==  a[0][0] - i) {
                        if(a[0][1]-i ==  a[1][1] - j && a[1][1]-j ==  a[2][1] - k && a[2][1]-k ==  a[0][1] - i) {
                            if(a[0][2]-i ==  a[1][2] - j && a[1][2]-j ==  a[2][2] - k && a[2][2]-k ==  a[0][2] - i) {
                                System.out.println("Yes");
                                return;
                            }
                        }
                    }
                }
            } int j = 0; int j = 0; j 0 j<=100 j 100 j++ j++ j {
                for(int k = 0; k<=100; k++) {
                    if(a[0][0]-i ==  a[1][0] - j && a[1][0]-j ==  a[2][0] - k && a[2][0]-k ==  a[0][0] - i) {
                        if(a[0][1]-i ==  a[1][1] - j && a[1][1]-j ==  a[2][1] - k && a[2][1]-k ==  a[0][1] - i) {
                            if(a[0][2]-i ==  a[1][2] - j && a[1][2]-j ==  a[2][2] - k && a[2][2]-k ==  a[0][2] - i) {
                                System.out.println("Yes");
                                return;
                            }
                        }
                    }
                }
            } {
                for(int k = 0; k<=100; k++) {
                    if(a[0][0]-i ==  a[1][0] - j && a[1][0]-j ==  a[2][0] - k && a[2][0]-k ==  a[0][0] - i) {
                        if(a[0][1]-i ==  a[1][1] - j && a[1][1]-j ==  a[2][1] - k && a[2][1]-k ==  a[0][1] - i) {
                            if(a[0][2]-i ==  a[1][2] - j && a[1][2]-j ==  a[2][2] - k && a[2][2]-k ==  a[0][2] - i) {
                                System.out.println("Yes");
                                return;
                            }
                        }
                    }
                }
            } for(int k = 0; k<=100; k++) {
                    if(a[0][0]-i ==  a[1][0] - j && a[1][0]-j ==  a[2][0] - k && a[2][0]-k ==  a[0][0] - i) {
                        if(a[0][1]-i ==  a[1][1] - j && a[1][1]-j ==  a[2][1] - k && a[2][1]-k ==  a[0][1] - i) {
                            if(a[0][2]-i ==  a[1][2] - j && a[1][2]-j ==  a[2][2] - k && a[2][2]-k ==  a[0][2] - i) {
                                System.out.println("Yes");
                                return;
                            }
                        }
                    }
                } int k = 0; int k = 0; k 0 k<=100 k 100 k++ k++ k {
                    if(a[0][0]-i ==  a[1][0] - j && a[1][0]-j ==  a[2][0] - k && a[2][0]-k ==  a[0][0] - i) {
                        if(a[0][1]-i ==  a[1][1] - j && a[1][1]-j ==  a[2][1] - k && a[2][1]-k ==  a[0][1] - i) {
                            if(a[0][2]-i ==  a[1][2] - j && a[1][2]-j ==  a[2][2] - k && a[2][2]-k ==  a[0][2] - i) {
                                System.out.println("Yes");
                                return;
                            }
                        }
                    }
                } {
                    if(a[0][0]-i ==  a[1][0] - j && a[1][0]-j ==  a[2][0] - k && a[2][0]-k ==  a[0][0] - i) {
                        if(a[0][1]-i ==  a[1][1] - j && a[1][1]-j ==  a[2][1] - k && a[2][1]-k ==  a[0][1] - i) {
                            if(a[0][2]-i ==  a[1][2] - j && a[1][2]-j ==  a[2][2] - k && a[2][2]-k ==  a[0][2] - i) {
                                System.out.println("Yes");
                                return;
                            }
                        }
                    }
                } if(a[0][0]-i ==  a[1][0] - j && a[1][0]-j ==  a[2][0] - k && a[2][0]-k ==  a[0][0] - i) {
                        if(a[0][1]-i ==  a[1][1] - j && a[1][1]-j ==  a[2][1] - k && a[2][1]-k ==  a[0][1] - i) {
                            if(a[0][2]-i ==  a[1][2] - j && a[1][2]-j ==  a[2][2] - k && a[2][2]-k ==  a[0][2] - i) {
                                System.out.println("Yes");
                                return;
                            }
                        }
                    } a[0][0]-i ==  a[1][0] - j && a[1][0]-j ==  a[2][0] - k && a[2][0]-k ==  a[0][0] - i a[0][0]-i ==  a[1][0] - j && a[1][0]-j ==  a[2][0] - k && a[2][0]-k ==  a[0][0] - i a[0][0]-i ==  a[1][0] - j a[0][0]-i a[0][0] a[0] a 0 0 i a[1][0] - j a[1][0] a[1] a 1 0 j a[1][0]-j ==  a[2][0] - k a[1][0]-j a[1][0] a[1] a 1 0 j a[2][0] - k a[2][0] a[2] a 2 0 k a[2][0]-k ==  a[0][0] - i a[2][0]-k a[2][0] a[2] a 2 0 k a[0][0] - i a[0][0] a[0] a 0 0 i {
                        if(a[0][1]-i ==  a[1][1] - j && a[1][1]-j ==  a[2][1] - k && a[2][1]-k ==  a[0][1] - i) {
                            if(a[0][2]-i ==  a[1][2] - j && a[1][2]-j ==  a[2][2] - k && a[2][2]-k ==  a[0][2] - i) {
                                System.out.println("Yes");
                                return;
                            }
                        }
                    } if(a[0][1]-i ==  a[1][1] - j && a[1][1]-j ==  a[2][1] - k && a[2][1]-k ==  a[0][1] - i) {
                            if(a[0][2]-i ==  a[1][2] - j && a[1][2]-j ==  a[2][2] - k && a[2][2]-k ==  a[0][2] - i) {
                                System.out.println("Yes");
                                return;
                            }
                        } a[0][1]-i ==  a[1][1] - j && a[1][1]-j ==  a[2][1] - k && a[2][1]-k ==  a[0][1] - i a[0][1]-i ==  a[1][1] - j && a[1][1]-j ==  a[2][1] - k && a[2][1]-k ==  a[0][1] - i a[0][1]-i ==  a[1][1] - j a[0][1]-i a[0][1] a[0] a 0 1 i a[1][1] - j a[1][1] a[1] a 1 1 j a[1][1]-j ==  a[2][1] - k a[1][1]-j a[1][1] a[1] a 1 1 j a[2][1] - k a[2][1] a[2] a 2 1 k a[2][1]-k ==  a[0][1] - i a[2][1]-k a[2][1] a[2] a 2 1 k a[0][1] - i a[0][1] a[0] a 0 1 i {
                            if(a[0][2]-i ==  a[1][2] - j && a[1][2]-j ==  a[2][2] - k && a[2][2]-k ==  a[0][2] - i) {
                                System.out.println("Yes");
                                return;
                            }
                        } if(a[0][2]-i ==  a[1][2] - j && a[1][2]-j ==  a[2][2] - k && a[2][2]-k ==  a[0][2] - i) {
                                System.out.println("Yes");
                                return;
                            } a[0][2]-i ==  a[1][2] - j && a[1][2]-j ==  a[2][2] - k && a[2][2]-k ==  a[0][2] - i a[0][2]-i ==  a[1][2] - j && a[1][2]-j ==  a[2][2] - k && a[2][2]-k ==  a[0][2] - i a[0][2]-i ==  a[1][2] - j a[0][2]-i a[0][2] a[0] a 0 2 i a[1][2] - j a[1][2] a[1] a 1 2 j a[1][2]-j ==  a[2][2] - k a[1][2]-j a[1][2] a[1] a 1 2 j a[2][2] - k a[2][2] a[2] a 2 2 k a[2][2]-k ==  a[0][2] - i a[2][2]-k a[2][2] a[2] a 2 2 k a[0][2] - i a[0][2] a[0] a 0 2 i {
                                System.out.println("Yes");
                                return;
                            } System.out.println("Yes") System.out.println System.out System System.out "Yes" return; System.out.println("No") System.out.println System.out System System.out "No" String[] args args
import java.util.*;
class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][] a = new int[3][3];
        for(int i = 0; i<3; i++) {
            for(int j = 0; j<3; j++) {
                a[i][j] = sc.nextInt();
            }
        }

        for(int i = 0; i<=100; i++) {
            for(int j = 0; j<=100; j++) {
                for(int k = 0; k<=100; k++) {
                    if(a[0][0]-i ==  a[1][0] - j && a[1][0]-j ==  a[2][0] - k && a[2][0]-k ==  a[0][0] - i) {
                        if(a[0][1]-i ==  a[1][1] - j && a[1][1]-j ==  a[2][1] - k && a[2][1]-k ==  a[0][1] - i) {
                            if(a[0][2]-i ==  a[1][2] - j && a[1][2]-j ==  a[2][2] - k && a[2][2]-k ==  a[0][2] - i) {
                                System.out.println("Yes");
                                return;
                            }
                        }
                    }
                }
            }
        }
        System.out.println("No");

    }
}