#import collections

#aa = collections.Counter(a) # list to list

#mod = 10**9 + 7

def readInts():

  return list(map(int,input().split()))

def main():

    C = [readInts() for _ in range(3)]

    a = [0] * 3

    b = [0] * 3

    # a[0] = 0としとく

    # 1つ適当に決めることでほかのものが決まる

    # それでちょいちょいやればよーい!

    for i in range(3):

        b[i] = C[0][i] - a[0]

    for i in range(1,3):

        a[i] = C[i][0] - b[0]

    for i in range(3):

        for j in range(3):

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

                pass

            else:

                print('No')

                exit()

    print('Yes')

if __name__ == '__main__':

  main()

c = [list(map(int,input().split())) for _ in range(3)]

#print(LIST)

# a1 = 0 とする

a,b= [0,0,0],[0,0,0]

for i in range(3):

    b[i] = c[0][i] - a[0]

for j in range(1,3):

    a[j] = c[j][0] - b[0]

for i in range(1,3):

    for j in range(1,3):

        #print(a,b)

        if c[j][i] == a[j] + b[i]:

            pass

        else:

            print('No')

            exit()

print('Yes')

# import collections
# aa = collections.Counter(a) # list to list
# mod = 10**9 + 7
def readInts():
    return list(map(int, input().split()))


def main():
    C = [readInts() for _ in range(3)]
    a = [0] * 3
    b = [0] * 3
    # a[0] = 0としとく
    # 1つ適当に決めることでほかのものが決まる
    # それでちょいちょいやればよーい!
    for i in range(3):
        b[i] = C[0][i] - a[0]
    for i in range(1, 3):
        a[i] = C[i][0] - b[0]
    for i in range(3):
        for j in range(3):
            if C[j][i] == a[j] + b[i]:
                pass
            else:
                print("No")
                exit()
    print("Yes")


if __name__ == "__main__":
    main()

c = [list(map(int, input().split())) for _ in range(3)]
# print(LIST)
# a1 = 0 とする
a, b = [0, 0, 0], [0, 0, 0]
for i in range(3):
    b[i] = c[0][i] - a[0]
for j in range(1, 3):
    a[j] = c[j][0] - b[0]
for i in range(1, 3):
    for j in range(1, 3):
        # print(a,b)
        if c[j][i] == a[j] + b[i]:
            pass
        else:
            print("No")
            exit()
print("Yes")

-# import collections -# aa = collections.Counter(a) # list to list -# mod = 10**9 + 7 -def readInts(): -    return list(map(int, input().split())) - - -def main(): -    C = [readInts() for _ in range(3)] -    a = [0] * 3 -    b = [0] * 3 -    # a[0] = 0としとく -    # 1つ適当に決めることでほかのものが決まる -    # それでちょいちょいやればよーい! -    for i in range(3): -        b[i] = C[0][i] - a[0] -    for i in range(1, 3): -        a[i] = C[i][0] - b[0] -    for i in range(3): -        for j in range(3): -            if C[j][i] == a[j] + b[i]: -                pass -            else: -                print("No") -                exit() -    print("Yes") - - -if __name__ == "__main__": -    main() +c = [list(map(int, input().split())) for _ in range(3)] +# print(LIST) +# a1 = 0 とする +a, b = [0, 0, 0], [0, 0, 0] +for i in range(3): +    b[i] = c[0][i] - a[0] +for j in range(1, 3): +    a[j] = c[j][0] - b[0] +for i in range(1, 3): +    for j in range(1, 3): +        # print(a,b) +        if c[j][i] == a[j] + b[i]: +            pass +        else: +            print("No") +            exit() +print("Yes")