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

if 2*c[0][2]-c[1][2]-c[2][2]+c[1][0]+c[2][0] == 2*c[0][0]:

  if 2*c[1][0]-c[2][0]-c[0][0]+c[2][1]+c[0][1] == 2*c[1][1]:

    if 2*c[2][1]-c[0][1]-c[1][1]+c[0][2]+c[1][2] == 2*c[2][2]:

      print('Yes')

    else:

      print('No')

  else:

    print('No')

else:

  print('No')
c = []

for i in range(3):

  c_ = list(map(int, input().split()))

  c.append(c_)

  

if c[2][2] == c[0][2] + c[2][0] -c[0][0] and c[2][2] == c[1][2] + c[2][1] -c[1][1] and c[1][1] == c[0][1] + c[1][0] -c[0][0]:

  print('Yes')

else:

  print('No')
c = [list(map(int, input().split())) for _ in range(3)]
if 2 * c[0][2] - c[1][2] - c[2][2] + c[1][0] + c[2][0] == 2 * c[0][0]:
    if 2 * c[1][0] - c[2][0] - c[0][0] + c[2][1] + c[0][1] == 2 * c[1][1]:
        if 2 * c[2][1] - c[0][1] - c[1][1] + c[0][2] + c[1][2] == 2 * c[2][2]:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")

c = []
for i in range(3):
    c_ = list(map(int, input().split()))
    c.append(c_)
if (
    c[2][2] == c[0][2] + c[2][0] - c[0][0]
    and c[2][2] == c[1][2] + c[2][1] - c[1][1]
    and c[1][1] == c[0][1] + c[1][0] - c[0][0]
):
    print("Yes")
else:
    print("No")

-c = [list(map(int, input().split())) for _ in range(3)] -if 2 * c[0][2] - c[1][2] - c[2][2] + c[1][0] + c[2][0] == 2 * c[0][0]: -    if 2 * c[1][0] - c[2][0] - c[0][0] + c[2][1] + c[0][1] == 2 * c[1][1]: -        if 2 * c[2][1] - c[0][1] - c[1][1] + c[0][2] + c[1][2] == 2 * c[2][2]: -            print("Yes") -        else: -            print("No") -    else: -        print("No") +c = [] +for i in range(3): +    c_ = list(map(int, input().split())) +    c.append(c_) +if ( +    c[2][2] == c[0][2] + c[2][0] - c[0][0] +    and c[2][2] == c[1][2] + c[2][1] - c[1][1] +    and c[1][1] == c[0][1] + c[1][0] - c[0][0] +): +    print("Yes")