c11, c12, c13 = list(map(int, input().split()))

c21, c22, c23 = list(map(int, input().split()))

c31, c32, c33 = list(map(int, input().split()))



def correct():

  if a1 + b2 != c12:

    return False

  if a1 + b3 != c13:

    return False

  if a2 + b1 != c21:

    return False

  if a2 + b3 != c23:

    return False

  if a3 + b1 != c31:

    return False

  if a3 + b2 != c32:

    return False

  return True



for i in range(c11 + 1):

  for j in range(c22 + 1):

    for k in range(c33 + 1):

      a1 = i

      b1 = c11 - i

      a2 = j

      b2 = c22 - j

      a3 = k

      b3 = c33 - k

      if correct():

        print('Yes')

        exit(0)



print('No')

c11, c12, c13 = list(map(int, input().split()))

c21, c22, c23 = list(map(int, input().split()))

c31, c32, c33 = list(map(int, input().split()))



def correct(a1, a2, a3, b1, b2, b3):

  if a1 + b1 != c11:

    return False

  if a2 + b2 != c22:

    return False

  if a3 + b3 != c33:

    return False

  if a1 + b2 != c12:

    return False

  if a1 + b3 != c13:

    return False

  if a2 + b1 != c21:

    return False

  if a2 + b3 != c23:

    return False

  if a3 + b1 != c31:

    return False

  if a3 + b2 != c32:

    return False

  return True



for i in range(c11 + 1):

  a1 = i

  b1 = c11 - i

  a2 = a1 - c11 + c21

  a3 = a1 - c11 + c31

  b2 = b1 - c11 + c12

  b3 = b1 - c11 + c13

  # print(a1, a2, a3, b1, b2, b3)

  if correct(a1, a2, a3, b1, b2, b3):

    print('Yes')

    exit(0)



# for i in range(c11 + 1):

#   for j in range(c22 + 1):

#     for k in range(c33 + 1):

#       a1 = i

#       b1 = c11 - i

#       a2 = j

#       b2 = c22 - j

#       a3 = k

#       b3 = c33 - k

#       if correct(a1, a2, a3, b1, b2, b3):

#         print('Yes')

#         exit(0)



print('No')

c11, c12, c13 = list(map(int, input().split()))
c21, c22, c23 = list(map(int, input().split()))
c31, c32, c33 = list(map(int, input().split()))


def correct():
    if a1 + b2 != c12:
        return False
    if a1 + b3 != c13:
        return False
    if a2 + b1 != c21:
        return False
    if a2 + b3 != c23:
        return False
    if a3 + b1 != c31:
        return False
    if a3 + b2 != c32:
        return False
    return True


for i in range(c11 + 1):
    for j in range(c22 + 1):
        for k in range(c33 + 1):
            a1 = i
            b1 = c11 - i
            a2 = j
            b2 = c22 - j
            a3 = k
            b3 = c33 - k
            if correct():
                print("Yes")
                exit(0)
print("No")

c11, c12, c13 = list(map(int, input().split()))
c21, c22, c23 = list(map(int, input().split()))
c31, c32, c33 = list(map(int, input().split()))


def correct(a1, a2, a3, b1, b2, b3):
    if a1 + b1 != c11:
        return False
    if a2 + b2 != c22:
        return False
    if a3 + b3 != c33:
        return False
    if a1 + b2 != c12:
        return False
    if a1 + b3 != c13:
        return False
    if a2 + b1 != c21:
        return False
    if a2 + b3 != c23:
        return False
    if a3 + b1 != c31:
        return False
    if a3 + b2 != c32:
        return False
    return True


for i in range(c11 + 1):
    a1 = i
    b1 = c11 - i
    a2 = a1 - c11 + c21
    a3 = a1 - c11 + c31
    b2 = b1 - c11 + c12
    b3 = b1 - c11 + c13
    # print(a1, a2, a3, b1, b2, b3)
    if correct(a1, a2, a3, b1, b2, b3):
        print("Yes")
        exit(0)
# for i in range(c11 + 1):
#   for j in range(c22 + 1):
#     for k in range(c33 + 1):
#       a1 = i
#       b1 = c11 - i
#       a2 = j
#       b2 = c22 - j
#       a3 = k
#       b3 = c33 - k
#       if correct(a1, a2, a3, b1, b2, b3):
#         print('Yes')
#         exit(0)
print("No")

-def correct(): +def correct(a1, a2, a3, b1, b2, b3): +    if a1 + b1 != c11: +        return False +    if a2 + b2 != c22: +        return False +    if a3 + b3 != c33: +        return False -    for j in range(c22 + 1): -        for k in range(c33 + 1): -            a1 = i -            b1 = c11 - i -            a2 = j -            b2 = c22 - j -            a3 = k -            b3 = c33 - k -            if correct(): -                print("Yes") -                exit(0) +    a1 = i +    b1 = c11 - i +    a2 = a1 - c11 + c21 +    a3 = a1 - c11 + c31 +    b2 = b1 - c11 + c12 +    b3 = b1 - c11 + c13 +    # print(a1, a2, a3, b1, b2, b3) +    if correct(a1, a2, a3, b1, b2, b3): +        print("Yes") +        exit(0) +# for i in range(c11 + 1): +#   for j in range(c22 + 1): +#     for k in range(c33 + 1): +#       a1 = i +#       b1 = c11 - i +#       a2 = j +#       b2 = c22 - j +#       a3 = k +#       b3 = c33 - k +#       if correct(a1, a2, a3, b1, b2, b3): +#         print('Yes') +#         exit(0)