l = [0]*3

for i in range(3):

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



for i in range(2):

  if l[0][i]-l[1][i] != l[0][i+1]-l[1][i+1]:

    print('No')

    exit()

  if l[1][i]-l[2][i] != l[1][i+1]-l[2][i+1]:

    print('No')

    exit()

else:

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



D = [[0]*3 for _ in range(2)]

for i in range(2):

    for j in range(3):

        D[i][j] = C[i+1][j]-C[i][j]



flag = True

if D[0][0] == D[0][1] and D[0][1] == D[0][2] and D[0][2] == D[0][0]:

    pass

else:

    flag = False



if D[1][0] == D[1][1] and D[1][1] == D[1][2] and D[1][2] == D[1][0]:

    pass

else:

    flag = False



if flag:

    print('Yes')

else:

    print('No')

l = [0] * 3
for i in range(3):
    l[i] = list(map(int, input().split()))
for i in range(2):
    if l[0][i] - l[1][i] != l[0][i + 1] - l[1][i + 1]:
        print("No")
        exit()
    if l[1][i] - l[2][i] != l[1][i + 1] - l[2][i + 1]:
        print("No")
        exit()
else:
    print("Yes")

C = [list(map(int, input().split())) for _ in range(3)]
D = [[0] * 3 for _ in range(2)]
for i in range(2):
    for j in range(3):
        D[i][j] = C[i + 1][j] - C[i][j]
flag = True
if D[0][0] == D[0][1] and D[0][1] == D[0][2] and D[0][2] == D[0][0]:
    pass
else:
    flag = False
if D[1][0] == D[1][1] and D[1][1] == D[1][2] and D[1][2] == D[1][0]:
    pass
else:
    flag = False
if flag:
    print("Yes")
else:
    print("No")

-l = [0] * 3 -for i in range(3): -    l[i] = list(map(int, input().split())) +C = [list(map(int, input().split())) for _ in range(3)] +D = [[0] * 3 for _ in range(2)] -    if l[0][i] - l[1][i] != l[0][i + 1] - l[1][i + 1]: -        print("No") -        exit() -    if l[1][i] - l[2][i] != l[1][i + 1] - l[2][i + 1]: -        print("No") -        exit() +    for j in range(3): +        D[i][j] = C[i + 1][j] - C[i][j] +flag = True +if D[0][0] == D[0][1] and D[0][1] == D[0][2] and D[0][2] == D[0][0]: +    pass +    flag = False +if D[1][0] == D[1][1] and D[1][1] == D[1][2] and D[1][2] == D[1][0]: +    pass +else: +    flag = False +if flag: +else: +    print("No")