c1 = list(map(int,input().split()))

c2 = list(map(int,input().split()))

c3 = list(map(int,input().split()))

if not c1[0]-c1[1] == c2[0]-c2[1] == c3[0]-c3[1]:

    print('No')

    exit()

if not c1[2]-c1[1] == c2[2]-c2[1] == c3[2]-c3[1]:

    print('No')

    exit()

if not c1[0]-c2[0] == c1[1]-c2[1] == c1[2]-c2[2]:

    print('No')

    exit()

if not c3[0]-c2[0] == c3[1]-c2[1] == c3[2]-c2[2]:

    print('No')

    exit()

print('Yes')
a1,a2,a3 = list(map(int,input().split()))

b1,b2,b3 = list(map(int,input().split()))

c1,c2,c3 = list(map(int,input().split()))



if not (a1-a2 == b1-b2 == c1-c2) or not (a2-a3 == b2-b3 == c2-c3):

    print('No')

elif not (a1-b1 == a2-b2 == a3-b3) or not (b1-c1 == b2-c2 == b3-c3):

    print('No')

else:

    print('Yes')
c1 = list(map(int, input().split()))
c2 = list(map(int, input().split()))
c3 = list(map(int, input().split()))
if not c1[0] - c1[1] == c2[0] - c2[1] == c3[0] - c3[1]:
    print("No")
    exit()
if not c1[2] - c1[1] == c2[2] - c2[1] == c3[2] - c3[1]:
    print("No")
    exit()
if not c1[0] - c2[0] == c1[1] - c2[1] == c1[2] - c2[2]:
    print("No")
    exit()
if not c3[0] - c2[0] == c3[1] - c2[1] == c3[2] - c2[2]:
    print("No")
    exit()
print("Yes")

a1, a2, a3 = list(map(int, input().split()))
b1, b2, b3 = list(map(int, input().split()))
c1, c2, c3 = list(map(int, input().split()))
if not (a1 - a2 == b1 - b2 == c1 - c2) or not (a2 - a3 == b2 - b3 == c2 - c3):
    print("No")
elif not (a1 - b1 == a2 - b2 == a3 - b3) or not (b1 - c1 == b2 - c2 == b3 - c3):
    print("No")
else:
    print("Yes")

-c1 = list(map(int, input().split())) -c2 = list(map(int, input().split())) -c3 = list(map(int, input().split())) -if not c1[0] - c1[1] == c2[0] - c2[1] == c3[0] - c3[1]: +a1, a2, a3 = list(map(int, input().split())) +b1, b2, b3 = list(map(int, input().split())) +c1, c2, c3 = list(map(int, input().split())) +if not (a1 - a2 == b1 - b2 == c1 - c2) or not (a2 - a3 == b2 - b3 == c2 - c3): -    exit() -if not c1[2] - c1[1] == c2[2] - c2[1] == c3[2] - c3[1]: +elif not (a1 - b1 == a2 - b2 == a3 - b3) or not (b1 - c1 == b2 - c2 == b3 - c3): -    exit() -if not c1[0] - c2[0] == c1[1] - c2[1] == c1[2] - c2[2]: -    print("No") -    exit() -if not c3[0] - c2[0] == c3[1] - c2[1] == c3[2] - c2[2]: -    print("No") -    exit() -print("Yes") +else: +    print("Yes")