import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scan = 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] = scan.nextInt();
            }
        }

        int min = C[0][0];
        for (int i=1; i<3; i++) {
            if (C[0][i] < min) min = C[0][i];
        }

        int check;
        for (int a1 = 0; a1 <= min; a1++) {
            int c11 = C[0][0] - a1;
            int a2 = C[1][0] - c11;
            int a3 = C[2][0] - c11;

            boolean flag = true;
            for (int i=1; i<3; i++) {
                check = C[0][i] - a1;
                if (C[1][i] - a2 != check || C[2][i] - a3 != check) {
                    flag = false;
                    break;
                }
            }

            if (flag == true) {
                System.out.println("Yes");
                System.exit(0);
            }
        }

        System.out.println("No");
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner scan = 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] = scan.nextInt();
            }
        }

        int min = C[0][0];
        for (int i=1; i<3; i++) {
            if (C[0][i] < min) min = C[0][i];
        }

        int check;
        for (int a1 = 0; a1 <= min; a1++) {
            int c11 = C[0][0] - a1;
            int a2 = C[1][0] - c11;
            int a3 = C[2][0] - c11;

            boolean flag = true;
            for (int i=1; i<3; i++) {
                check = C[0][i] - a1;
                if (C[1][i] - a2 != check || C[2][i] - a3 != check) {
                    flag = false;
                    break;
                }
            }

            if (flag == true) {
                System.out.println("Yes");
                System.exit(0);
            }
        }

        System.out.println("No");
    }
} Main public static void main(String[] args) {
        Scanner scan = 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] = scan.nextInt();
            }
        }

        int min = C[0][0];
        for (int i=1; i<3; i++) {
            if (C[0][i] < min) min = C[0][i];
        }

        int check;
        for (int a1 = 0; a1 <= min; a1++) {
            int c11 = C[0][0] - a1;
            int a2 = C[1][0] - c11;
            int a3 = C[2][0] - c11;

            boolean flag = true;
            for (int i=1; i<3; i++) {
                check = C[0][i] - a1;
                if (C[1][i] - a2 != check || C[2][i] - a3 != check) {
                    flag = false;
                    break;
                }
            }

            if (flag == true) {
                System.out.println("Yes");
                System.exit(0);
            }
        }

        System.out.println("No");
    } main {
        Scanner scan = 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] = scan.nextInt();
            }
        }

        int min = C[0][0];
        for (int i=1; i<3; i++) {
            if (C[0][i] < min) min = C[0][i];
        }

        int check;
        for (int a1 = 0; a1 <= min; a1++) {
            int c11 = C[0][0] - a1;
            int a2 = C[1][0] - c11;
            int a3 = C[2][0] - c11;

            boolean flag = true;
            for (int i=1; i<3; i++) {
                check = C[0][i] - a1;
                if (C[1][i] - a2 != check || C[2][i] - a3 != check) {
                    flag = false;
                    break;
                }
            }

            if (flag == true) {
                System.out.println("Yes");
                System.exit(0);
            }
        }

        System.out.println("No");
    } Scanner scan = new Scanner(System.in); scan 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] = scan.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] = scan.nextInt();
            }
        } {
            for (int j=0; j<3; j++) {
                C[i][j] = scan.nextInt();
            }
        } for (int j=0; j<3; j++) {
                C[i][j] = scan.nextInt();
            } int j=0; int j=0; j 0 j<3 j 3 j++ j++ j {
                C[i][j] = scan.nextInt();
            } {
                C[i][j] = scan.nextInt();
            } C[i][j] = scan.nextInt() C[i][j] C[i] C i j scan.nextInt() scan.nextInt scan int min = C[0][0]; min C[0][0] C[0] C 0 0 for (int i=1; i<3; i++) {
            if (C[0][i] < min) min = C[0][i];
        } int i=1; int i=1; i 1 i<3 i 3 i++ i++ i {
            if (C[0][i] < min) min = C[0][i];
        } {
            if (C[0][i] < min) min = C[0][i];
        } if (C[0][i] < min) min = C[0][i]; C[0][i] < min C[0][i] C[0] C 0 i min min = C[0][i] min C[0][i] C[0] C 0 i int check; check for (int a1 = 0; a1 <= min; a1++) {
            int c11 = C[0][0] - a1;
            int a2 = C[1][0] - c11;
            int a3 = C[2][0] - c11;

            boolean flag = true;
            for (int i=1; i<3; i++) {
                check = C[0][i] - a1;
                if (C[1][i] - a2 != check || C[2][i] - a3 != check) {
                    flag = false;
                    break;
                }
            }

            if (flag == true) {
                System.out.println("Yes");
                System.exit(0);
            }
        } int a1 = 0; int a1 = 0; a1 0 a1 <= min a1 min a1++ a1++ a1 {
            int c11 = C[0][0] - a1;
            int a2 = C[1][0] - c11;
            int a3 = C[2][0] - c11;

            boolean flag = true;
            for (int i=1; i<3; i++) {
                check = C[0][i] - a1;
                if (C[1][i] - a2 != check || C[2][i] - a3 != check) {
                    flag = false;
                    break;
                }
            }

            if (flag == true) {
                System.out.println("Yes");
                System.exit(0);
            }
        } {
            int c11 = C[0][0] - a1;
            int a2 = C[1][0] - c11;
            int a3 = C[2][0] - c11;

            boolean flag = true;
            for (int i=1; i<3; i++) {
                check = C[0][i] - a1;
                if (C[1][i] - a2 != check || C[2][i] - a3 != check) {
                    flag = false;
                    break;
                }
            }

            if (flag == true) {
                System.out.println("Yes");
                System.exit(0);
            }
        } int c11 = C[0][0] - a1; c11 C[0][0] - a1 C[0][0] C[0] C 0 0 a1 int a2 = C[1][0] - c11; a2 C[1][0] - c11 C[1][0] C[1] C 1 0 c11 int a3 = C[2][0] - c11; a3 C[2][0] - c11 C[2][0] C[2] C 2 0 c11 boolean flag = true; flag true for (int i=1; i<3; i++) {
                check = C[0][i] - a1;
                if (C[1][i] - a2 != check || C[2][i] - a3 != check) {
                    flag = false;
                    break;
                }
            } int i=1; int i=1; i 1 i<3 i 3 i++ i++ i {
                check = C[0][i] - a1;
                if (C[1][i] - a2 != check || C[2][i] - a3 != check) {
                    flag = false;
                    break;
                }
            } {
                check = C[0][i] - a1;
                if (C[1][i] - a2 != check || C[2][i] - a3 != check) {
                    flag = false;
                    break;
                }
            } check = C[0][i] - a1 check C[0][i] - a1 C[0][i] C[0] C 0 i a1 if (C[1][i] - a2 != check || C[2][i] - a3 != check) {
                    flag = false;
                    break;
                } C[1][i] - a2 != check || C[2][i] - a3 != check C[1][i] - a2 != check C[1][i] - a2 C[1][i] C[1] C 1 i a2 check C[2][i] - a3 != check C[2][i] - a3 C[2][i] C[2] C 2 i a3 check {
                    flag = false;
                    break;
                } flag = false flag false break; if (flag == true) {
                System.out.println("Yes");
                System.exit(0);
            } flag == true flag true {
                System.out.println("Yes");
                System.exit(0);
            } System.out.println("Yes") System.out.println System.out System System.out "Yes" System.exit(0) System.exit System 0 System.out.println("No") System.out.println System.out System System.out "No" String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scan = 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] = scan.nextInt();
            }
        }

        int min = C[0][0];
        for (int i=1; i<3; i++) {
            if (C[0][i] < min) min = C[0][i];
        }

        int check;
        for (int a1 = 0; a1 <= min; a1++) {
            int c11 = C[0][0] - a1;
            int a2 = C[1][0] - c11;
            int a3 = C[2][0] - c11;

            boolean flag = true;
            for (int i=1; i<3; i++) {
                check = C[0][i] - a1;
                if (C[1][i] - a2 != check || C[2][i] - a3 != check) {
                    flag = false;
                    break;
                }
            }

            if (flag == true) {
                System.out.println("Yes");
                System.exit(0);
            }
        }

        System.out.println("No");
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scan = 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] = scan.nextInt();
            }
        }

        int min = C[0][0];
        for (int i=1; i<3; i++) {
            if (C[0][i] < min) min = C[0][i];
        }

        int check;
        for (int a1 = 0; a1 <= min; a1++) {
            int c11 = C[0][0] - a1;
            int a2 = C[1][0] - c11;
            int a3 = C[2][0] - c11;

            boolean flag = true;
            for (int i=1; i<3; i++) {
                check = C[0][i] - a1;
                if (C[1][i] - a2 != check || C[2][i] - a3 != check) {
                    flag = false;
                    break;
                }
            }

            if (flag == true) {
                System.out.println("Yes");
                System.exit(0);
            }
        }

        System.out.println("No");
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scan = 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] = scan.nextInt();
            }
        }

        int min = C[0][0];
        for (int i=1; i<3; i++) {
            if (C[0][i] < min) min = C[0][i];
        }

        int check;
        for (int a1 = 0; a1 <= min; a1++) {
            int c11 = C[0][0] - a1;
            int a2 = C[1][0] - c11;
            int a3 = C[2][0] - c11;

            boolean flag = true;
            for (int i=1; i<3; i++) {
                check = C[0][i] - a1;
                if (C[1][i] - a2 != check || C[2][i] - a3 != check) {
                    flag = false;
                    break;
                }
            }

            if (flag == true) {
                System.out.println("Yes");
                System.exit(0);
            }
        }

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