cnt = 0

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

try :

  for j in range(c1+1):

    for k in range(c2+1):

      for l in range(c3+1):

        if c1-j == c2-k == c3-l:

          c4, c5, c6 = list(map(int, input().split()))

          if c4 - j == c5 -k == c6 -l:

              c7, c8, c9 = list(map(int, input().split()))

              if c7 - j == c8 -k == c9 -l:

                cnt += 1

                break

except EOFError:

  pass

if cnt != 0:

  print("Yes")

else:

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

c4, c5, c6 = list(map(int, input().split()))

c7, c8, c9 = list(map(int, input().split()))

if c1 - c2 == c4 - c5 == c7 - c8 and c3 - c2 == c6 - c5 == c9 - c8:

  print("Yes")

else:

  print("No")
cnt = 0
c1, c2, c3 = list(map(int, input().split()))
try:
    for j in range(c1 + 1):
        for k in range(c2 + 1):
            for l in range(c3 + 1):
                if c1 - j == c2 - k == c3 - l:
                    c4, c5, c6 = list(map(int, input().split()))
                    if c4 - j == c5 - k == c6 - l:
                        c7, c8, c9 = list(map(int, input().split()))
                        if c7 - j == c8 - k == c9 - l:
                            cnt += 1
                            break
except EOFError:
    pass
if cnt != 0:
    print("Yes")
else:
    print("No")

c1, c2, c3 = list(map(int, input().split()))
c4, c5, c6 = list(map(int, input().split()))
c7, c8, c9 = list(map(int, input().split()))
if c1 - c2 == c4 - c5 == c7 - c8 and c3 - c2 == c6 - c5 == c9 - c8:
    print("Yes")
else:
    print("No")

-cnt = 0 -try: -    for j in range(c1 + 1): -        for k in range(c2 + 1): -            for l in range(c3 + 1): -                if c1 - j == c2 - k == c3 - l: -                    c4, c5, c6 = list(map(int, input().split())) -                    if c4 - j == c5 - k == c6 - l: -                        c7, c8, c9 = list(map(int, input().split())) -                        if c7 - j == c8 - k == c9 - l: -                            cnt += 1 -                            break -except EOFError: -    pass -if cnt != 0: +c4, c5, c6 = list(map(int, input().split())) +c7, c8, c9 = list(map(int, input().split())) +if c1 - c2 == c4 - c5 == c7 - c8 and c3 - c2 == c6 - c5 == c9 - c8: