c = []

for _ in range(3):

    c.append(list(map(int, input().split())))

a = []

for i in range(3):

    tmp = []

    for j in range(3):

        tmp.append(c[i][j%3] - c[i][(j+1)%3])

    a.append(tmp)

for i in range(2):

    for j in range(3):

        if a[i][j]!=a[i+1][j]:

            print('No')

            break

    else:

        continue

    break

else:

    print('Yes')
c = []

for _ in range(3):

    c.append(list(map(int, input().split())))



for i in range(2):

    if c[i][0]-c[i][1]!=c[i+1][0]-c[i+1][1]:

        print('No')

        break

    if c[i][1]-c[i][2]!=c[i+1][1]-c[i+1][2]:

        print('No')

        break

    if c[i][2]-c[i][0]!=c[i+1][2]-c[i+1][0]:

        print('No')

        break

else:

    print('Yes')
c = []
for _ in range(3):
    c.append(list(map(int, input().split())))
a = []
for i in range(3):
    tmp = []
    for j in range(3):
        tmp.append(c[i][j % 3] - c[i][(j + 1) % 3])
    a.append(tmp)
for i in range(2):
    for j in range(3):
        if a[i][j] != a[i + 1][j]:
            print("No")
            break
    else:
        continue
    break
else:
    print("Yes")

c = []
for _ in range(3):
    c.append(list(map(int, input().split())))
for i in range(2):
    if c[i][0] - c[i][1] != c[i + 1][0] - c[i + 1][1]:
        print("No")
        break
    if c[i][1] - c[i][2] != c[i + 1][1] - c[i + 1][2]:
        print("No")
        break
    if c[i][2] - c[i][0] != c[i + 1][2] - c[i + 1][0]:
        print("No")
        break
else:
    print("Yes")

-a = [] -for i in range(3): -    tmp = [] -    for j in range(3): -        tmp.append(c[i][j % 3] - c[i][(j + 1) % 3]) -    a.append(tmp) -    for j in range(3): -        if a[i][j] != a[i + 1][j]: -            print("No") -            break -    else: -        continue -    break +    if c[i][0] - c[i][1] != c[i + 1][0] - c[i + 1][1]: +        print("No") +        break +    if c[i][1] - c[i][2] != c[i + 1][1] - c[i + 1][2]: +        print("No") +        break +    if c[i][2] - c[i][0] != c[i + 1][2] - c[i + 1][0]: +        print("No") +        break