# ABC 088 C



from collections import deque



def resolve():

    def all_same(a, b, c):

        if a ==b and b ==c:

            return True

        return False



    c = []

    for _ in range(3):

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

    ans = True



    if not all_same(c[0][0]-c[1][0], c[0][1] - c[1][1], c[0][2]-c[1][2]):

        ans = False

    if not all_same(c[0][0]-c[2][0], c[0][1] - c[2][1], c[0][2]-c[2][2]):

        ans = False

    if not all_same(c[0][0] - c[0][1], c[1][0] - c[1][1], c[2][0] - c[2][1]):

        ans = False

    if not all_same(c[0][0] - c[0][2], c[1][0] - c[1][2], c[2][0] - c[2][2]):

        ans = False



    if ans:

        print('Yes')

    else:

        print('No')





if __name__ == "__main__":

    resolve()

def resolve():

  c = []

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

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

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

  a01 = c[0][0] - c[0][1]

  a02 = c[0][0] - c[0][2]

  a12 = c[0][1] - c[0][2]

  b01 = c[0][0] - c[1][0]

  b02 = c[0][0] - c[2][0]

  b12 = c[1][0] - c[2][0]

  for i in range(3):

    if ((c[i][0] - c[i][1]) != a01) or (c[i][0] - c[i][2] != a02) or (c[i][1] - c[i][2] != a12):

      return False

    if ((c[0][i] - c[1][i]) != b01 or (c[0][i] - c[2][i]) != b02 or (c[1][i] - c[2][i]) != b12):

      return False



  return True



if __name__ == "__main__":

  if (resolve()):

    print("Yes")

  else:

    print("No")

# ABC 088 C
from collections import deque


def resolve():
    def all_same(a, b, c):
        if a == b and b == c:
            return True
        return False

    c = []
    for _ in range(3):
        c.append(list(map(int, input().split())))
    ans = True
    if not all_same(c[0][0] - c[1][0], c[0][1] - c[1][1], c[0][2] - c[1][2]):
        ans = False
    if not all_same(c[0][0] - c[2][0], c[0][1] - c[2][1], c[0][2] - c[2][2]):
        ans = False
    if not all_same(c[0][0] - c[0][1], c[1][0] - c[1][1], c[2][0] - c[2][1]):
        ans = False
    if not all_same(c[0][0] - c[0][2], c[1][0] - c[1][2], c[2][0] - c[2][2]):
        ans = False
    if ans:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    resolve()

def resolve():
    c = []
    c.append(list(map(int, input().split())))
    c.append(list(map(int, input().split())))
    c.append(list(map(int, input().split())))
    a01 = c[0][0] - c[0][1]
    a02 = c[0][0] - c[0][2]
    a12 = c[0][1] - c[0][2]
    b01 = c[0][0] - c[1][0]
    b02 = c[0][0] - c[2][0]
    b12 = c[1][0] - c[2][0]
    for i in range(3):
        if (
            ((c[i][0] - c[i][1]) != a01)
            or (c[i][0] - c[i][2] != a02)
            or (c[i][1] - c[i][2] != a12)
        ):
            return False
        if (
            (c[0][i] - c[1][i]) != b01
            or (c[0][i] - c[2][i]) != b02
            or (c[1][i] - c[2][i]) != b12
        ):
            return False
    return True


if __name__ == "__main__":
    if resolve():
        print("Yes")
    else:
        print("No")

-# ABC 088 C -from collections import deque +def resolve(): +    c = [] +    c.append(list(map(int, input().split()))) +    c.append(list(map(int, input().split()))) +    c.append(list(map(int, input().split()))) +    a01 = c[0][0] - c[0][1] +    a02 = c[0][0] - c[0][2] +    a12 = c[0][1] - c[0][2] +    b01 = c[0][0] - c[1][0] +    b02 = c[0][0] - c[2][0] +    b12 = c[1][0] - c[2][0] +    for i in range(3): +        if ( +            ((c[i][0] - c[i][1]) != a01) +            or (c[i][0] - c[i][2] != a02) +            or (c[i][1] - c[i][2] != a12) +        ): +            return False +        if ( +            (c[0][i] - c[1][i]) != b01 +            or (c[0][i] - c[2][i]) != b02 +            or (c[1][i] - c[2][i]) != b12 +        ): +            return False +    return True -def resolve(): -    def all_same(a, b, c): -        if a == b and b == c: -            return True -        return False - -    c = [] -    for _ in range(3): -        c.append(list(map(int, input().split()))) -    ans = True -    if not all_same(c[0][0] - c[1][0], c[0][1] - c[1][1], c[0][2] - c[1][2]): -        ans = False -    if not all_same(c[0][0] - c[2][0], c[0][1] - c[2][1], c[0][2] - c[2][2]): -        ans = False -    if not all_same(c[0][0] - c[0][1], c[1][0] - c[1][1], c[2][0] - c[2][1]): -        ans = False -    if not all_same(c[0][0] - c[0][2], c[1][0] - c[1][2], c[2][0] - c[2][2]): -        ans = False -    if ans: +if __name__ == "__main__": +    if resolve(): - - -if __name__ == "__main__": -    resolve()