def c_takahashi_information(C):

    a = [min(C[0]), min(C[1]), min(C[2])]

    tmp = [[C[i][j] - a[i] for j in range(3)] for i in range(3)]

    b = list(map(list, set(map(tuple, tmp))))

    for bb in b:

        f = True

        for i in range(3):

            for j in range(3):

                if a[i] + bb[j] != C[i][j]:

                    f = False

                    break

            if not f:

                break

        if f:



            return 'Yes'

    return 'No'

  

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

print((c_takahashi_information(C)))
def c_takahashi_information(C):

    b = [C[0][i] - 0 for i in range(3)]

    a = [0] + [C[i][0] - b[0] for i in range(1, 3)]  # a_1=0と仮定してよい

    for i in range(3):

        for j in range(3):

            if a[i] + b[j] != C[i][j]:

                return 'No'

    return 'Yes'



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

print((c_takahashi_information(C)))
def c_takahashi_information(C):
    a = [min(C[0]), min(C[1]), min(C[2])]
    tmp = [[C[i][j] - a[i] for j in range(3)] for i in range(3)]
    b = list(map(list, set(map(tuple, tmp))))
    for bb in b:
        f = True
        for i in range(3):
            for j in range(3):
                if a[i] + bb[j] != C[i][j]:
                    f = False
                    break
            if not f:
                break
        if f:
            return "Yes"
    return "No"


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

def c_takahashi_information(C):
    b = [C[0][i] - 0 for i in range(3)]
    a = [0] + [C[i][0] - b[0] for i in range(1, 3)]  # a_1=0と仮定してよい
    for i in range(3):
        for j in range(3):
            if a[i] + b[j] != C[i][j]:
                return "No"
    return "Yes"


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

-    a = [min(C[0]), min(C[1]), min(C[2])] -    tmp = [[C[i][j] - a[i] for j in range(3)] for i in range(3)] -    b = list(map(list, set(map(tuple, tmp)))) -    for bb in b: -        f = True -        for i in range(3): -            for j in range(3): -                if a[i] + bb[j] != C[i][j]: -                    f = False -                    break -            if not f: -                break -        if f: -            return "Yes" -    return "No" +    b = [C[0][i] - 0 for i in range(3)] +    a = [0] + [C[i][0] - b[0] for i in range(1, 3)]  # a_1=0と仮定してよい +    for i in range(3): +        for j in range(3): +            if a[i] + b[j] != C[i][j]: +                return "No" +    return "Yes"