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



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

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

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

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



print(("Yes" if q1 and q2 and q3 and q4 else "No"))

[(a, b, c), (d, e, f), (g, h, i)] = [

    list(map(int, input().split())) for i in range(3)]



q1 = a - b == d - e== g - h

q2 = a - c == d - f == g - i

q3 = a - d == b - e== c - f

q4 = a - g == b - h == c - i



print(("Yes" if q1 and q2 and q3 and q4 else "No"))

c = [list(map(int, input().split())) for i in range(3)]
q1 = c[0][0] - c[0][1] == c[1][0] - c[1][1] == c[2][0] - c[2][1]
q2 = c[0][0] - c[0][2] == c[1][0] - c[1][2] == c[2][0] - c[2][2]
q3 = c[0][0] - c[1][0] == c[0][1] - c[1][1] == c[0][2] - c[1][2]
q4 = c[0][0] - c[2][0] == c[0][1] - c[2][1] == c[0][2] - c[2][2]
print(("Yes" if q1 and q2 and q3 and q4 else "No"))

[(a, b, c), (d, e, f), (g, h, i)] = [list(map(int, input().split())) for i in range(3)]
q1 = a - b == d - e == g - h
q2 = a - c == d - f == g - i
q3 = a - d == b - e == c - f
q4 = a - g == b - h == c - i
print(("Yes" if q1 and q2 and q3 and q4 else "No"))

-c = [list(map(int, input().split())) for i in range(3)] -q1 = c[0][0] - c[0][1] == c[1][0] - c[1][1] == c[2][0] - c[2][1] -q2 = c[0][0] - c[0][2] == c[1][0] - c[1][2] == c[2][0] - c[2][2] -q3 = c[0][0] - c[1][0] == c[0][1] - c[1][1] == c[0][2] - c[1][2] -q4 = c[0][0] - c[2][0] == c[0][1] - c[2][1] == c[0][2] - c[2][2] +[(a, b, c), (d, e, f), (g, h, i)] = [list(map(int, input().split())) for i in range(3)] +q1 = a - b == d - e == g - h +q2 = a - c == d - f == g - i +q3 = a - d == b - e == c - f +q4 = a - g == b - h == c - i