import numpy as np

c=np.array([[int(i) for i in input().split()] for _ in range(3)])



b123=c[0]

a123=np.array([

    0,

    c[1][1]-b123[1],

    c[2][2]-b123[2],

])



isOk=True

for i in range(3):

    for j in range(3):

        if c[i][j]!=a123[i]+b123[j]:

            isOk=False



ans="Yes" if isOk else "No"

print(ans)

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



x = C[0][0]

a = [c[0] - x for c in C]

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



ans = "Yes"

for i in range(3):

    for j in range(3):

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

            ans = "No"



print(ans)

import numpy as np

c = np.array([[int(i) for i in input().split()] for _ in range(3)])
b123 = c[0]
a123 = np.array(
    [
        0,
        c[1][1] - b123[1],
        c[2][2] - b123[2],
    ]
)
isOk = True
for i in range(3):
    for j in range(3):
        if c[i][j] != a123[i] + b123[j]:
            isOk = False
ans = "Yes" if isOk else "No"
print(ans)

C = [list(map(int, input().split())) for _ in range(3)]
x = C[0][0]
a = [c[0] - x for c in C]
b = [C[0][i] - a[0] for i in range(3)]
ans = "Yes"
for i in range(3):
    for j in range(3):
        if C[i][j] != a[i] + b[j]:
            ans = "No"
print(ans)

-import numpy as np - -c = np.array([[int(i) for i in input().split()] for _ in range(3)]) -b123 = c[0] -a123 = np.array( -    [ -        0, -        c[1][1] - b123[1], -        c[2][2] - b123[2], -    ] -) -isOk = True +C = [list(map(int, input().split())) for _ in range(3)] +x = C[0][0] +a = [c[0] - x for c in C] +b = [C[0][i] - a[0] for i in range(3)] +ans = "Yes" -        if c[i][j] != a123[i] + b123[j]: -            isOk = False -ans = "Yes" if isOk else "No" +        if C[i][j] != a[i] + b[j]: +            ans = "No"