def main():

    import numpy as np

    A = np.array([[1, 0, 0, 1, 0, 0],

                  [1, 0, 0, 0, 1, 0],

                  [1, 0, 0, 0, 0, 1],

                  [0, 1, 0, 1, 0, 0],

                  [0, 1, 0, 0, 1, 0],

                  [0, 1, 0, 0, 0, 1],

                  [0, 0, 1, 1, 0, 0],

                  [0, 0, 1, 0, 1, 0],

                  [0, 0, 1, 0, 0, 1]])

    C = [[int(i) for i in input().split()] for j in range(3)]

    C = np.array(C)

    C = C.reshape([9, 1])

    ext_A = np.concatenate([A, C], axis=1)

    A_rank = np.linalg.matrix_rank(A)

    ext_A_rank = np.linalg.matrix_rank(ext_A)

    # 拡大係数行列と係数行列のrankが等しければ解が存在する

    if A_rank == ext_A_rank:

        print("Yes")

    else:

        print("No")





if __name__ == '__main__':

    main()

def main():

    A = [[int(i) for i in input().split()] for j in range(3)]

    from itertools import product

    for a1, a2, a3 in product(range(101), repeat=3):

        c1 = A[0][0] - a1 == A[1][0] - a2 == A[2][0] - a3

        c2 = A[0][1] - a1 == A[1][1] - a2 == A[2][1] - a3

        c3 = A[0][2] - a1 == A[1][2] - a2 == A[2][2] - a3

        if c1 and c2 and c3:

            return print("Yes")

    print("No")





if __name__ == '__main__':

    main()

def main():
    import numpy as np

    A = np.array(
        [
            [1, 0, 0, 1, 0, 0],
            [1, 0, 0, 0, 1, 0],
            [1, 0, 0, 0, 0, 1],
            [0, 1, 0, 1, 0, 0],
            [0, 1, 0, 0, 1, 0],
            [0, 1, 0, 0, 0, 1],
            [0, 0, 1, 1, 0, 0],
            [0, 0, 1, 0, 1, 0],
            [0, 0, 1, 0, 0, 1],
        ]
    )
    C = [[int(i) for i in input().split()] for j in range(3)]
    C = np.array(C)
    C = C.reshape([9, 1])
    ext_A = np.concatenate([A, C], axis=1)
    A_rank = np.linalg.matrix_rank(A)
    ext_A_rank = np.linalg.matrix_rank(ext_A)
    # 拡大係数行列と係数行列のrankが等しければ解が存在する
    if A_rank == ext_A_rank:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()

def main():
    A = [[int(i) for i in input().split()] for j in range(3)]
    from itertools import product

    for a1, a2, a3 in product(range(101), repeat=3):
        c1 = A[0][0] - a1 == A[1][0] - a2 == A[2][0] - a3
        c2 = A[0][1] - a1 == A[1][1] - a2 == A[2][1] - a3
        c3 = A[0][2] - a1 == A[1][2] - a2 == A[2][2] - a3
        if c1 and c2 and c3:
            return print("Yes")
    print("No")


if __name__ == "__main__":
    main()

-    import numpy as np +    A = [[int(i) for i in input().split()] for j in range(3)] +    from itertools import product -    A = np.array( -        [ -            [1, 0, 0, 1, 0, 0], -            [1, 0, 0, 0, 1, 0], -            [1, 0, 0, 0, 0, 1], -            [0, 1, 0, 1, 0, 0], -            [0, 1, 0, 0, 1, 0], -            [0, 1, 0, 0, 0, 1], -            [0, 0, 1, 1, 0, 0], -            [0, 0, 1, 0, 1, 0], -            [0, 0, 1, 0, 0, 1], -        ] -    ) -    C = [[int(i) for i in input().split()] for j in range(3)] -    C = np.array(C) -    C = C.reshape([9, 1]) -    ext_A = np.concatenate([A, C], axis=1) -    A_rank = np.linalg.matrix_rank(A) -    ext_A_rank = np.linalg.matrix_rank(ext_A) -    # 拡大係数行列と係数行列のrankが等しければ解が存在する -    if A_rank == ext_A_rank: -        print("Yes") -    else: -        print("No") +    for a1, a2, a3 in product(range(101), repeat=3): +        c1 = A[0][0] - a1 == A[1][0] - a2 == A[2][0] - a3 +        c2 = A[0][1] - a1 == A[1][1] - a2 == A[2][1] - a3 +        c3 = A[0][2] - a1 == A[1][2] - a2 == A[2][2] - a3 +        if c1 and c2 and c3: +            return print("Yes") +    print("No")