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

for h in [0,1]:

  for w in [0,1]: 

    if g[h][w]+g[h+1][w+1]!=g[h+1][w]+g[h][w+1]:

      exit(print('No'))

print('Yes')

m=lambda:list(map(int,input().split()))

a,b,c=m()

d,e,f=m()

g,h,i=m()

print((['No','Yes'][d-a==e-b==f-c and g-a==h-b==i-c]))
g = [[*map(int, input().split())] for _ in range(3)]
for h in [0, 1]:
    for w in [0, 1]:
        if g[h][w] + g[h + 1][w + 1] != g[h + 1][w] + g[h][w + 1]:
            exit(print("No"))
print("Yes")

m = lambda: list(map(int, input().split()))
a, b, c = m()
d, e, f = m()
g, h, i = m()
print((["No", "Yes"][d - a == e - b == f - c and g - a == h - b == i - c]))

-g = [[*map(int, input().split())] for _ in range(3)] -for h in [0, 1]: -    for w in [0, 1]: -        if g[h][w] + g[h + 1][w + 1] != g[h + 1][w] + g[h][w + 1]: -            exit(print("No")) -print("Yes") +m = lambda: list(map(int, input().split())) +a, b, c = m() +d, e, f = m() +g, h, i = m() +print((["No", "Yes"][d - a == e - b == f - c and g - a == h - b == i - c]))