c = []

for i in range(3):

    c.append(list(map(int, input().split())))

tmp = [[] for i in range(4)]

for i in range(3):

    tmp[0].append(c[1][i] - c[0][i])

    tmp[1].append(c[2][i] - c[0][i])

    tmp[2].append(c[i][1] - c[i][0])

    tmp[3].append(c[i][2] - c[i][0])

if set([len(set(i)) for i in tmp]) == {1}:

    print('Yes')

else:

    print('No')

c = []

for i in range(3):

    c.append(list(map(int, input().split())))

tmp = [[] for i in range(4)]

for i in range(3):

    for j in range(2):

        tmp[j].append(c[j+1][i] - c[0][i])

        tmp[j+2].append(c[i][j+1] - c[i][0])

if set([len(set(i)) for i in tmp]) == {1}:

    print('Yes')

else:

    print('No')

c = []
for i in range(3):
    c.append(list(map(int, input().split())))
tmp = [[] for i in range(4)]
for i in range(3):
    tmp[0].append(c[1][i] - c[0][i])
    tmp[1].append(c[2][i] - c[0][i])
    tmp[2].append(c[i][1] - c[i][0])
    tmp[3].append(c[i][2] - c[i][0])
if set([len(set(i)) for i in tmp]) == {1}:
    print("Yes")
else:
    print("No")

c = []
for i in range(3):
    c.append(list(map(int, input().split())))
tmp = [[] for i in range(4)]
for i in range(3):
    for j in range(2):
        tmp[j].append(c[j + 1][i] - c[0][i])
        tmp[j + 2].append(c[i][j + 1] - c[i][0])
if set([len(set(i)) for i in tmp]) == {1}:
    print("Yes")
else:
    print("No")

-    tmp[0].append(c[1][i] - c[0][i]) -    tmp[1].append(c[2][i] - c[0][i]) -    tmp[2].append(c[i][1] - c[i][0]) -    tmp[3].append(c[i][2] - c[i][0]) +    for j in range(2): +        tmp[j].append(c[j + 1][i] - c[0][i]) +        tmp[j + 2].append(c[i][j + 1] - c[i][0])