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



ans = False



for i in range(101) :

    a1 = 0

    b1 = c[0][0]

    b2 = c[0][1]

    b3 = c[0][2]

    a2 = c[1][0] - b1

    a3 = c[2][0] - b1

    a = []

    a.append(a1)

    a.append(a2)

    a.append(a3)

    if a2 + b2 != c[1][1] :

        continue

    elif a3 + b2 != c[2][1] :

        continue

    elif a2 + b3 != c[1][2] :

        continue

    elif a3 + b3 != c[2][2] :

        continue

    ans = True

    break



if ans :

    print('Yes')

else :

    print('No')

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



ans = True



X = 0

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

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



for i in range(3) :

    for j in range(3) :

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

            ans = False



if ans :

    print('Yes')

else :

    print('No')

c = [list(map(int, input().split())) for i in range(3)]
ans = False
for i in range(101):
    a1 = 0
    b1 = c[0][0]
    b2 = c[0][1]
    b3 = c[0][2]
    a2 = c[1][0] - b1
    a3 = c[2][0] - b1
    a = []
    a.append(a1)
    a.append(a2)
    a.append(a3)
    if a2 + b2 != c[1][1]:
        continue
    elif a3 + b2 != c[2][1]:
        continue
    elif a2 + b3 != c[1][2]:
        continue
    elif a3 + b3 != c[2][2]:
        continue
    ans = True
    break
if ans:
    print("Yes")
else:
    print("No")

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

-ans = False -for i in range(101): -    a1 = 0 -    b1 = c[0][0] -    b2 = c[0][1] -    b3 = c[0][2] -    a2 = c[1][0] - b1 -    a3 = c[2][0] - b1 -    a = [] -    a.append(a1) -    a.append(a2) -    a.append(a3) -    if a2 + b2 != c[1][1]: -        continue -    elif a3 + b2 != c[2][1]: -        continue -    elif a2 + b3 != c[1][2]: -        continue -    elif a3 + b3 != c[2][2]: -        continue -    ans = True -    break +ans = True +X = 0 +b = [c[i][0] - X for i in range(3)] +a = [c[0][i] - b[0] for i in range(3)] +for i in range(3): +    for j in range(3): +        if a[j] + b[i] != c[i][j]: +            ans = False