from itertools import product as p



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



a = [0]*3

b = [0]*3

for a1 in range(c[0][0]+1):

    a[0] = a1

    b[0] = c[0][0] - a1

    for a2 in range(c[1][1]+1):

        a[1] = a2

        b[1] = c[1][1] - a2

        for a3 in range(c[2][2]+1):

            a[2] = a3

            b[2] = c[2][2] - a3



            for i, j in p(list(range(3)), list(range(3))):

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

                    break

            else:

                print('Yes')

                exit()



print('No')

from itertools import product as p

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



a = [-1]*3

a[0] = 0

b = c[0]

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

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



for i, j in p(list(range(3)), list(range(3))):

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

        print('No')

        break

else:

    print('Yes')

from itertools import product as p

c = [list(map(int, input().split())) for _ in range(3)]
a = [0] * 3
b = [0] * 3
for a1 in range(c[0][0] + 1):
    a[0] = a1
    b[0] = c[0][0] - a1
    for a2 in range(c[1][1] + 1):
        a[1] = a2
        b[1] = c[1][1] - a2
        for a3 in range(c[2][2] + 1):
            a[2] = a3
            b[2] = c[2][2] - a3
            for i, j in p(list(range(3)), list(range(3))):
                if c[i][j] != a[i] + b[j]:
                    break
            else:
                print("Yes")
                exit()
print("No")

from itertools import product as p

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

-a = [0] * 3 -b = [0] * 3 -for a1 in range(c[0][0] + 1): -    a[0] = a1 -    b[0] = c[0][0] - a1 -    for a2 in range(c[1][1] + 1): -        a[1] = a2 -        b[1] = c[1][1] - a2 -        for a3 in range(c[2][2] + 1): -            a[2] = a3 -            b[2] = c[2][2] - a3 -            for i, j in p(list(range(3)), list(range(3))): -                if c[i][j] != a[i] + b[j]: -                    break -            else: -                print("Yes") -                exit() -print("No") +a = [-1] * 3 +a[0] = 0 +b = c[0] +a[1] = c[1][0] - b[0] +a[2] = c[2][0] - b[0] +for i, j in p(list(range(3)), list(range(3))): +    if c[i][j] != a[i] + b[j]: +        print("No") +        break +else: +    print("Yes")