import numpy as np



c = [[0]*3] * 3



for i in range(3):

    c[i] = list(map(int, input().split()))



c = np.array(c)



if len(set(c[0] - c[1])) == 1 and len(set(c[1] - c[2])) == 1 and len(set(c[:,0] - c[:,1])) == 1 and len(set(c[:,1] - c[:,2])) == 1:

    print("Yes")

else:

    print("No")





grid = list()

for a in range(3):

    a, b, c = list(map(int, input().split()))

    grid.append([a, b, c])



ans = 'No'



for a1 in range(0, 101):

    for a2 in range(0, 101):

        b1 = grid[0][0] - a1

        b2 = grid[1][1] - a2

        a3 = grid[2][1] - b2

        b3 = grid[2][2] - a3



        a_list = [a1, a2, a3]

        b_list = [b1, b2, b3]



        count = 0

        for x in range(3):

            for y in range(3):

                if grid[x][y] == a_list[x] + b_list[y]:

                    count += 1

        if count == 9:

            ans = 'Yes'

            break



print(ans)

import numpy as np

c = [[0] * 3] * 3
for i in range(3):
    c[i] = list(map(int, input().split()))
c = np.array(c)
if (
    len(set(c[0] - c[1])) == 1
    and len(set(c[1] - c[2])) == 1
    and len(set(c[:, 0] - c[:, 1])) == 1
    and len(set(c[:, 1] - c[:, 2])) == 1
):
    print("Yes")
else:
    print("No")

grid = list()
for a in range(3):
    a, b, c = list(map(int, input().split()))
    grid.append([a, b, c])
ans = "No"
for a1 in range(0, 101):
    for a2 in range(0, 101):
        b1 = grid[0][0] - a1
        b2 = grid[1][1] - a2
        a3 = grid[2][1] - b2
        b3 = grid[2][2] - a3
        a_list = [a1, a2, a3]
        b_list = [b1, b2, b3]
        count = 0
        for x in range(3):
            for y in range(3):
                if grid[x][y] == a_list[x] + b_list[y]:
                    count += 1
        if count == 9:
            ans = "Yes"
            break
print(ans)

-import numpy as np - -c = [[0] * 3] * 3 -for i in range(3): -    c[i] = list(map(int, input().split())) -c = np.array(c) -if ( -    len(set(c[0] - c[1])) == 1 -    and len(set(c[1] - c[2])) == 1 -    and len(set(c[:, 0] - c[:, 1])) == 1 -    and len(set(c[:, 1] - c[:, 2])) == 1 -): -    print("Yes") -else: -    print("No") +grid = list() +for a in range(3): +    a, b, c = list(map(int, input().split())) +    grid.append([a, b, c]) +ans = "No" +for a1 in range(0, 101): +    for a2 in range(0, 101): +        b1 = grid[0][0] - a1 +        b2 = grid[1][1] - a2 +        a3 = grid[2][1] - b2 +        b3 = grid[2][2] - a3 +        a_list = [a1, a2, a3] +        b_list = [b1, b2, b3] +        count = 0 +        for x in range(3): +            for y in range(3): +                if grid[x][y] == a_list[x] + b_list[y]: +                    count += 1 +        if count == 9: +            ans = "Yes" +            break +print(ans)