import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int[][] C = new int[3][3];
            for (int r = 0; r < 3; r++) {
                for (int c = 0; c < 3; c++) {
                    C[r][c] = in.nextInt();
                }
            }

            int[] a = new int[3];
            int[] b = new int[3];
            int[][] a2 = new int[3][3];
            a[0] = 0;

            for (int c = 0; c < 3; c++) {
                b[c] = C[0][c] - a[0];
            }

            for (int r = 0; r < 3; r++) {
                for (int c = 0; c < 3; c++) {
                    a2[r][c] = C[r][c] - b[c];
                }
            }

            for (int r = 0; r < 3; r++) {
                for (int c = 1; c < 3; c++) {
                    if (a2[r][c - 1] != a2[r][c]) {
                        System.out.println("No");
                        return;
                    }
                }
            }
            System.out.println("Yes");
        }
    }
}

/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz