A = [[int(i) for i in input().split()] for i in range(3)]

diff1 = []

diff2 = []



for i in range(3):

    diff1.append(A[0][i] - A[1][i])

    

for i in range(3):

    diff2.append(A[1][i] - A[2][i])

    

if len(set(diff1)) == 1 and len(set(diff2)) == 1:

    print('Yes')

else:

    print('No')
A = [[int(i) for i in input().split()] for i in range(3)]

ans = 'Yes'



for i in range(2):

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

        ans = 'No'

        break

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

        ans = 'No'

        break

        

print(ans)
A = [[int(i) for i in input().split()] for i in range(3)]
diff1 = []
diff2 = []
for i in range(3):
    diff1.append(A[0][i] - A[1][i])
for i in range(3):
    diff2.append(A[1][i] - A[2][i])
if len(set(diff1)) == 1 and len(set(diff2)) == 1:
    print("Yes")
else:
    print("No")

A = [[int(i) for i in input().split()] for i in range(3)]
ans = "Yes"
for i in range(2):
    if A[i][0] - A[i + 1][0] != A[i][1] - A[i + 1][1]:
        ans = "No"
        break
    if A[i][1] - A[i + 1][1] != A[i][2] - A[i + 1][2]:
        ans = "No"
        break
print(ans)

-diff1 = [] -diff2 = [] -for i in range(3): -    diff1.append(A[0][i] - A[1][i]) -for i in range(3): -    diff2.append(A[1][i] - A[2][i]) -if len(set(diff1)) == 1 and len(set(diff2)) == 1: -    print("Yes") -else: -    print("No") +ans = "Yes" +for i in range(2): +    if A[i][0] - A[i + 1][0] != A[i][1] - A[i + 1][1]: +        ans = "No" +        break +    if A[i][1] - A[i + 1][1] != A[i][2] - A[i + 1][2]: +        ans = "No" +        break +print(ans)