import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] C1 = new int[3];
        int[] C2 = new int[3];
        int[] C3 = new int[3];
        for (int i = 0; i < 3; ++i) {
            C1[i] = sc.nextInt();
            C2[i] = sc.nextInt();
            C3[i] = sc.nextInt();
        }
        if (sol(C1) != sol(C2) || sol(C2) != sol(C3)) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        }
    }

    private static int sol(int[] C) {
        Arrays.sort(C);
        int sum = 0;
        for (int n : C) {
            sum += n;
        }
        return sum - C[0] * C.length;
    }
} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] C1 = new int[3];
        int[] C2 = new int[3];
        int[] C3 = new int[3];
        for (int i = 0; i < 3; ++i) {
            C1[i] = sc.nextInt();
            C2[i] = sc.nextInt();
            C3[i] = sc.nextInt();
        }
        if (sol(C1) != sol(C2) || sol(C2) != sol(C3)) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        }
    }

    private static int sol(int[] C) {
        Arrays.sort(C);
        int sum = 0;
        for (int n : C) {
            sum += n;
        }
        return sum - C[0] * C.length;
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] C1 = new int[3];
        int[] C2 = new int[3];
        int[] C3 = new int[3];
        for (int i = 0; i < 3; ++i) {
            C1[i] = sc.nextInt();
            C2[i] = sc.nextInt();
            C3[i] = sc.nextInt();
        }
        if (sol(C1) != sol(C2) || sol(C2) != sol(C3)) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int[] C1 = new int[3];
        int[] C2 = new int[3];
        int[] C3 = new int[3];
        for (int i = 0; i < 3; ++i) {
            C1[i] = sc.nextInt();
            C2[i] = sc.nextInt();
            C3[i] = sc.nextInt();
        }
        if (sol(C1) != sol(C2) || sol(C2) != sol(C3)) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] C1 = new int[3]; C1 new int[3] 3 int[] C2 = new int[3]; C2 new int[3] 3 int[] C3 = new int[3]; C3 new int[3] 3 for (int i = 0; i < 3; ++i) {
            C1[i] = sc.nextInt();
            C2[i] = sc.nextInt();
            C3[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < 3 i 3 ++i ++i i {
            C1[i] = sc.nextInt();
            C2[i] = sc.nextInt();
            C3[i] = sc.nextInt();
        } {
            C1[i] = sc.nextInt();
            C2[i] = sc.nextInt();
            C3[i] = sc.nextInt();
        } C1[i] = sc.nextInt() C1[i] C1 i sc.nextInt() sc.nextInt sc C2[i] = sc.nextInt() C2[i] C2 i sc.nextInt() sc.nextInt sc C3[i] = sc.nextInt() C3[i] C3 i sc.nextInt() sc.nextInt sc if (sol(C1) != sol(C2) || sol(C2) != sol(C3)) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        } sol(C1) != sol(C2) || sol(C2) != sol(C3) sol(C1) != sol(C2) sol(C1) sol C1 sol(C2) sol C2 sol(C2) != sol(C3) sol(C2) sol C2 sol(C3) sol C3 {
            System.out.println("No");
        } System.out.println("No") System.out.println System.out System System.out "No" {
            System.out.println("Yes");
        } System.out.println("Yes") System.out.println System.out System System.out "Yes" String[] args args private static int sol(int[] C) {
        Arrays.sort(C);
        int sum = 0;
        for (int n : C) {
            sum += n;
        }
        return sum - C[0] * C.length;
    } sol {
        Arrays.sort(C);
        int sum = 0;
        for (int n : C) {
            sum += n;
        }
        return sum - C[0] * C.length;
    } Arrays.sort(C) Arrays.sort Arrays C int sum = 0; sum 0 for (int n : C) {
            sum += n;
        } int n C {
            sum += n;
        } {
            sum += n;
        } sum += n sum n return sum - C[0] * C.length; sum - C[0] * C.length sum C[0] * C.length C[0] C 0 C.length C C.length int[] C C public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] C1 = new int[3];
        int[] C2 = new int[3];
        int[] C3 = new int[3];
        for (int i = 0; i < 3; ++i) {
            C1[i] = sc.nextInt();
            C2[i] = sc.nextInt();
            C3[i] = sc.nextInt();
        }
        if (sol(C1) != sol(C2) || sol(C2) != sol(C3)) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        }
    }

    private static int sol(int[] C) {
        Arrays.sort(C);
        int sum = 0;
        for (int n : C) {
            sum += n;
        }
        return sum - C[0] * C.length;
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] C1 = new int[3];
        int[] C2 = new int[3];
        int[] C3 = new int[3];
        for (int i = 0; i < 3; ++i) {
            C1[i] = sc.nextInt();
            C2[i] = sc.nextInt();
            C3[i] = sc.nextInt();
        }
        if (sol(C1) != sol(C2) || sol(C2) != sol(C3)) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        }
    }

    private static int sol(int[] C) {
        Arrays.sort(C);
        int sum = 0;
        for (int n : C) {
            sum += n;
        }
        return sum - C[0] * C.length;
    }
} Main
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] C1 = new int[3];
        int[] C2 = new int[3];
        int[] C3 = new int[3];
        for (int i = 0; i < 3; ++i) {
            C1[i] = sc.nextInt();
            C2[i] = sc.nextInt();
            C3[i] = sc.nextInt();
        }
        if (sol(C1) != sol(C2) || sol(C2) != sol(C3)) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        }
    }

    private static int sol(int[] C) {
        Arrays.sort(C);
        int sum = 0;
        for (int n : C) {
            sum += n;
        }
        return sum - C[0] * C.length;
    }
}