import java.util.*;

public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);

        int leftTop = sc.nextInt();
        int middleTop = sc.nextInt();
        int rightTop = sc.nextInt();
        int leftMiddle = sc.nextInt();
        int middleMiddle = sc.nextInt();
        int rightMiddle = sc.nextInt();
        int leftDown = sc.nextInt();
        int middleDown = sc.nextInt();
        int rightDown = sc.nextInt();

        String ans = "Yes";
        int[] aTop = {0, leftTop - middleTop, leftTop - rightTop};
        int[] aMiddle = {0, leftMiddle - middleMiddle, leftMiddle - rightMiddle};
        int[] aDown = {0, leftDown - middleDown, leftDown - rightDown};

        int[] bLeft = {0, leftTop - leftMiddle, leftTop - leftDown};
        int[] bMiddle = {0, middleTop - middleMiddle, middleTop - middleDown};
        int[] bRight = {0, rightTop - rightMiddle, rightTop - rightDown};

        if (!Arrays.equals(aTop, aMiddle) || !Arrays.equals(aTop, aDown)) {
            ans = "No";
        }

        if (!Arrays.equals(bLeft, bMiddle) || !Arrays.equals(bLeft, bRight)) {
            ans = "No";
        }

        System.out.println(ans);
    }
} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);

        int leftTop = sc.nextInt();
        int middleTop = sc.nextInt();
        int rightTop = sc.nextInt();
        int leftMiddle = sc.nextInt();
        int middleMiddle = sc.nextInt();
        int rightMiddle = sc.nextInt();
        int leftDown = sc.nextInt();
        int middleDown = sc.nextInt();
        int rightDown = sc.nextInt();

        String ans = "Yes";
        int[] aTop = {0, leftTop - middleTop, leftTop - rightTop};
        int[] aMiddle = {0, leftMiddle - middleMiddle, leftMiddle - rightMiddle};
        int[] aDown = {0, leftDown - middleDown, leftDown - rightDown};

        int[] bLeft = {0, leftTop - leftMiddle, leftTop - leftDown};
        int[] bMiddle = {0, middleTop - middleMiddle, middleTop - middleDown};
        int[] bRight = {0, rightTop - rightMiddle, rightTop - rightDown};

        if (!Arrays.equals(aTop, aMiddle) || !Arrays.equals(aTop, aDown)) {
            ans = "No";
        }

        if (!Arrays.equals(bLeft, bMiddle) || !Arrays.equals(bLeft, bRight)) {
            ans = "No";
        }

        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);

        int leftTop = sc.nextInt();
        int middleTop = sc.nextInt();
        int rightTop = sc.nextInt();
        int leftMiddle = sc.nextInt();
        int middleMiddle = sc.nextInt();
        int rightMiddle = sc.nextInt();
        int leftDown = sc.nextInt();
        int middleDown = sc.nextInt();
        int rightDown = sc.nextInt();

        String ans = "Yes";
        int[] aTop = {0, leftTop - middleTop, leftTop - rightTop};
        int[] aMiddle = {0, leftMiddle - middleMiddle, leftMiddle - rightMiddle};
        int[] aDown = {0, leftDown - middleDown, leftDown - rightDown};

        int[] bLeft = {0, leftTop - leftMiddle, leftTop - leftDown};
        int[] bMiddle = {0, middleTop - middleMiddle, middleTop - middleDown};
        int[] bRight = {0, rightTop - rightMiddle, rightTop - rightDown};

        if (!Arrays.equals(aTop, aMiddle) || !Arrays.equals(aTop, aDown)) {
            ans = "No";
        }

        if (!Arrays.equals(bLeft, bMiddle) || !Arrays.equals(bLeft, bRight)) {
            ans = "No";
        }

        System.out.println(ans);
    } main {
        // write your code here
        Scanner sc = new Scanner(System.in);

        int leftTop = sc.nextInt();
        int middleTop = sc.nextInt();
        int rightTop = sc.nextInt();
        int leftMiddle = sc.nextInt();
        int middleMiddle = sc.nextInt();
        int rightMiddle = sc.nextInt();
        int leftDown = sc.nextInt();
        int middleDown = sc.nextInt();
        int rightDown = sc.nextInt();

        String ans = "Yes";
        int[] aTop = {0, leftTop - middleTop, leftTop - rightTop};
        int[] aMiddle = {0, leftMiddle - middleMiddle, leftMiddle - rightMiddle};
        int[] aDown = {0, leftDown - middleDown, leftDown - rightDown};

        int[] bLeft = {0, leftTop - leftMiddle, leftTop - leftDown};
        int[] bMiddle = {0, middleTop - middleMiddle, middleTop - middleDown};
        int[] bRight = {0, rightTop - rightMiddle, rightTop - rightDown};

        if (!Arrays.equals(aTop, aMiddle) || !Arrays.equals(aTop, aDown)) {
            ans = "No";
        }

        if (!Arrays.equals(bLeft, bMiddle) || !Arrays.equals(bLeft, bRight)) {
            ans = "No";
        }

        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int leftTop = sc.nextInt(); leftTop sc.nextInt() sc.nextInt sc int middleTop = sc.nextInt(); middleTop sc.nextInt() sc.nextInt sc int rightTop = sc.nextInt(); rightTop sc.nextInt() sc.nextInt sc int leftMiddle = sc.nextInt(); leftMiddle sc.nextInt() sc.nextInt sc int middleMiddle = sc.nextInt(); middleMiddle sc.nextInt() sc.nextInt sc int rightMiddle = sc.nextInt(); rightMiddle sc.nextInt() sc.nextInt sc int leftDown = sc.nextInt(); leftDown sc.nextInt() sc.nextInt sc int middleDown = sc.nextInt(); middleDown sc.nextInt() sc.nextInt sc int rightDown = sc.nextInt(); rightDown sc.nextInt() sc.nextInt sc String ans = "Yes"; ans "Yes" int[] aTop = {0, leftTop - middleTop, leftTop - rightTop}; aTop {0, leftTop - middleTop, leftTop - rightTop} 0 leftTop - middleTop leftTop middleTop leftTop - rightTop leftTop rightTop int[] aMiddle = {0, leftMiddle - middleMiddle, leftMiddle - rightMiddle}; aMiddle {0, leftMiddle - middleMiddle, leftMiddle - rightMiddle} 0 leftMiddle - middleMiddle leftMiddle middleMiddle leftMiddle - rightMiddle leftMiddle rightMiddle int[] aDown = {0, leftDown - middleDown, leftDown - rightDown}; aDown {0, leftDown - middleDown, leftDown - rightDown} 0 leftDown - middleDown leftDown middleDown leftDown - rightDown leftDown rightDown int[] bLeft = {0, leftTop - leftMiddle, leftTop - leftDown}; bLeft {0, leftTop - leftMiddle, leftTop - leftDown} 0 leftTop - leftMiddle leftTop leftMiddle leftTop - leftDown leftTop leftDown int[] bMiddle = {0, middleTop - middleMiddle, middleTop - middleDown}; bMiddle {0, middleTop - middleMiddle, middleTop - middleDown} 0 middleTop - middleMiddle middleTop middleMiddle middleTop - middleDown middleTop middleDown int[] bRight = {0, rightTop - rightMiddle, rightTop - rightDown}; bRight {0, rightTop - rightMiddle, rightTop - rightDown} 0 rightTop - rightMiddle rightTop rightMiddle rightTop - rightDown rightTop rightDown if (!Arrays.equals(aTop, aMiddle) || !Arrays.equals(aTop, aDown)) {
            ans = "No";
        } !Arrays.equals(aTop, aMiddle) || !Arrays.equals(aTop, aDown) !Arrays.equals(aTop, aMiddle) Arrays.equals(aTop, aMiddle) Arrays.equals Arrays aTop aMiddle !Arrays.equals(aTop, aDown) Arrays.equals(aTop, aDown) Arrays.equals Arrays aTop aDown {
            ans = "No";
        } ans = "No" ans "No" if (!Arrays.equals(bLeft, bMiddle) || !Arrays.equals(bLeft, bRight)) {
            ans = "No";
        } !Arrays.equals(bLeft, bMiddle) || !Arrays.equals(bLeft, bRight) !Arrays.equals(bLeft, bMiddle) Arrays.equals(bLeft, bMiddle) Arrays.equals Arrays bLeft bMiddle !Arrays.equals(bLeft, bRight) Arrays.equals(bLeft, bRight) Arrays.equals Arrays bLeft bRight {
            ans = "No";
        } ans = "No" ans "No" System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);

        int leftTop = sc.nextInt();
        int middleTop = sc.nextInt();
        int rightTop = sc.nextInt();
        int leftMiddle = sc.nextInt();
        int middleMiddle = sc.nextInt();
        int rightMiddle = sc.nextInt();
        int leftDown = sc.nextInt();
        int middleDown = sc.nextInt();
        int rightDown = sc.nextInt();

        String ans = "Yes";
        int[] aTop = {0, leftTop - middleTop, leftTop - rightTop};
        int[] aMiddle = {0, leftMiddle - middleMiddle, leftMiddle - rightMiddle};
        int[] aDown = {0, leftDown - middleDown, leftDown - rightDown};

        int[] bLeft = {0, leftTop - leftMiddle, leftTop - leftDown};
        int[] bMiddle = {0, middleTop - middleMiddle, middleTop - middleDown};
        int[] bRight = {0, rightTop - rightMiddle, rightTop - rightDown};

        if (!Arrays.equals(aTop, aMiddle) || !Arrays.equals(aTop, aDown)) {
            ans = "No";
        }

        if (!Arrays.equals(bLeft, bMiddle) || !Arrays.equals(bLeft, bRight)) {
            ans = "No";
        }

        System.out.println(ans);
    }
} public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);

        int leftTop = sc.nextInt();
        int middleTop = sc.nextInt();
        int rightTop = sc.nextInt();
        int leftMiddle = sc.nextInt();
        int middleMiddle = sc.nextInt();
        int rightMiddle = sc.nextInt();
        int leftDown = sc.nextInt();
        int middleDown = sc.nextInt();
        int rightDown = sc.nextInt();

        String ans = "Yes";
        int[] aTop = {0, leftTop - middleTop, leftTop - rightTop};
        int[] aMiddle = {0, leftMiddle - middleMiddle, leftMiddle - rightMiddle};
        int[] aDown = {0, leftDown - middleDown, leftDown - rightDown};

        int[] bLeft = {0, leftTop - leftMiddle, leftTop - leftDown};
        int[] bMiddle = {0, middleTop - middleMiddle, middleTop - middleDown};
        int[] bRight = {0, rightTop - rightMiddle, rightTop - rightDown};

        if (!Arrays.equals(aTop, aMiddle) || !Arrays.equals(aTop, aDown)) {
            ans = "No";
        }

        if (!Arrays.equals(bLeft, bMiddle) || !Arrays.equals(bLeft, bRight)) {
            ans = "No";
        }

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

public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);

        int leftTop = sc.nextInt();
        int middleTop = sc.nextInt();
        int rightTop = sc.nextInt();
        int leftMiddle = sc.nextInt();
        int middleMiddle = sc.nextInt();
        int rightMiddle = sc.nextInt();
        int leftDown = sc.nextInt();
        int middleDown = sc.nextInt();
        int rightDown = sc.nextInt();

        String ans = "Yes";
        int[] aTop = {0, leftTop - middleTop, leftTop - rightTop};
        int[] aMiddle = {0, leftMiddle - middleMiddle, leftMiddle - rightMiddle};
        int[] aDown = {0, leftDown - middleDown, leftDown - rightDown};

        int[] bLeft = {0, leftTop - leftMiddle, leftTop - leftDown};
        int[] bMiddle = {0, middleTop - middleMiddle, middleTop - middleDown};
        int[] bRight = {0, rightTop - rightMiddle, rightTop - rightDown};

        if (!Arrays.equals(aTop, aMiddle) || !Arrays.equals(aTop, aDown)) {
            ans = "No";
        }

        if (!Arrays.equals(bLeft, bMiddle) || !Arrays.equals(bLeft, bRight)) {
            ans = "No";
        }

        System.out.println(ans);
    }
}