import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in);) {
            solve(sc);
        }
    }

    public static void solve(Scanner sc) {
        int[][] matrix = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                matrix[i][j] = sc.nextInt();
            }
        }

        int[] a = new int[3];
        int[] b = new int[3];
        a[0] = 0;
        b[0] = matrix[0][0] - a[0];
        b[1] = matrix[0][1] - a[0];
        b[2] = matrix[0][2] - a[0];
        a[1] = matrix[1][0] - b[0];
        a[2] = matrix[2][0] - b[0];
        
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                if (matrix[i][j] != a[i] + b[j]) {
                    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 sc = new Scanner(System.in);) {
            solve(sc);
        }
    }

    public static void solve(Scanner sc) {
        int[][] matrix = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                matrix[i][j] = sc.nextInt();
            }
        }

        int[] a = new int[3];
        int[] b = new int[3];
        a[0] = 0;
        b[0] = matrix[0][0] - a[0];
        b[1] = matrix[0][1] - a[0];
        b[2] = matrix[0][2] - a[0];
        a[1] = matrix[1][0] - b[0];
        a[2] = matrix[2][0] - b[0];
        
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                if (matrix[i][j] != a[i] + b[j]) {
                    System.out.println("No");
                    return;
                }
            }
        }
        
        System.out.println("Yes");
    }
} Main public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in);) {
            solve(sc);
        }
    } main {
        try (Scanner sc = new Scanner(System.in);) {
            solve(sc);
        }
    } try (Scanner sc = new Scanner(System.in);) {
            solve(sc);
        } {
            solve(sc);
        } Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) solve(sc) solve sc String[] args args public static void solve(Scanner sc) {
        int[][] matrix = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                matrix[i][j] = sc.nextInt();
            }
        }

        int[] a = new int[3];
        int[] b = new int[3];
        a[0] = 0;
        b[0] = matrix[0][0] - a[0];
        b[1] = matrix[0][1] - a[0];
        b[2] = matrix[0][2] - a[0];
        a[1] = matrix[1][0] - b[0];
        a[2] = matrix[2][0] - b[0];
        
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                if (matrix[i][j] != a[i] + b[j]) {
                    System.out.println("No");
                    return;
                }
            }
        }
        
        System.out.println("Yes");
    } solve {
        int[][] matrix = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                matrix[i][j] = sc.nextInt();
            }
        }

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

    public static void solve(Scanner sc) {
        int[][] matrix = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                matrix[i][j] = sc.nextInt();
            }
        }

        int[] a = new int[3];
        int[] b = new int[3];
        a[0] = 0;
        b[0] = matrix[0][0] - a[0];
        b[1] = matrix[0][1] - a[0];
        b[2] = matrix[0][2] - a[0];
        a[1] = matrix[1][0] - b[0];
        a[2] = matrix[2][0] - b[0];
        
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                if (matrix[i][j] != a[i] + b[j]) {
                    System.out.println("No");
                    return;
                }
            }
        }
        
        System.out.println("Yes");
    }
} public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in);) {
            solve(sc);
        }
    }

    public static void solve(Scanner sc) {
        int[][] matrix = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                matrix[i][j] = sc.nextInt();
            }
        }

        int[] a = new int[3];
        int[] b = new int[3];
        a[0] = 0;
        b[0] = matrix[0][0] - a[0];
        b[1] = matrix[0][1] - a[0];
        b[2] = matrix[0][2] - a[0];
        a[1] = matrix[1][0] - b[0];
        a[2] = matrix[2][0] - b[0];
        
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                if (matrix[i][j] != a[i] + b[j]) {
                    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 sc = new Scanner(System.in);) {
            solve(sc);
        }
    }

    public static void solve(Scanner sc) {
        int[][] matrix = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                matrix[i][j] = sc.nextInt();
            }
        }

        int[] a = new int[3];
        int[] b = new int[3];
        a[0] = 0;
        b[0] = matrix[0][0] - a[0];
        b[1] = matrix[0][1] - a[0];
        b[2] = matrix[0][2] - a[0];
        a[1] = matrix[1][0] - b[0];
        a[2] = matrix[2][0] - b[0];
        
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                if (matrix[i][j] != a[i] + b[j]) {
                    System.out.println("No");
                    return;
                }
            }
        }
        
        System.out.println("Yes");
    }
}