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

C = [0,0,0]

for j in range(3):

    for i in range(3):

        C[j] += A[i][j]

R = [0,0,0]

for i in range(3):

    for j in range(3):

        R[i] += A[i][j]

if (C[0]-C[1])%3==0 and (C[1]-C[2])%3==0 and (R[0]-R[1])%3==0 and (R[1]-R[2])%3==0:

    print("Yes")

else:

    print("No")
C = [list(map(int,input().split())) for _ in range(3)]

if C[0][0]-C[0][1]==C[1][0]-C[1][1]==C[2][0]-C[2][1] and C[0][1]-C[0][2]==C[1][1]-C[1][2]==C[2][1]-C[2][2] \

    and C[1][0]-C[0][0]==C[1][1]-C[0][1]==C[1][2]-C[0][2] and C[2][0]-C[1][0]==C[2][1]-C[1][1]==C[2][2]-C[1][2]:

    print("Yes")

else:

    print("No")

A = [list(map(int, input().split())) for _ in range(3)]
C = [0, 0, 0]
for j in range(3):
    for i in range(3):
        C[j] += A[i][j]
R = [0, 0, 0]
for i in range(3):
    for j in range(3):
        R[i] += A[i][j]
if (
    (C[0] - C[1]) % 3 == 0
    and (C[1] - C[2]) % 3 == 0
    and (R[0] - R[1]) % 3 == 0
    and (R[1] - R[2]) % 3 == 0
):
    print("Yes")
else:
    print("No")

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

-A = [list(map(int, input().split())) for _ in range(3)] -C = [0, 0, 0] -for j in range(3): -    for i in range(3): -        C[j] += A[i][j] -R = [0, 0, 0] -for i in range(3): -    for j in range(3): -        R[i] += A[i][j] +C = [list(map(int, input().split())) for _ in range(3)] -    (C[0] - C[1]) % 3 == 0 -    and (C[1] - C[2]) % 3 == 0 -    and (R[0] - R[1]) % 3 == 0 -    and (R[1] - R[2]) % 3 == 0 +    C[0][0] - C[0][1] == C[1][0] - C[1][1] == C[2][0] - C[2][1] +    and C[0][1] - C[0][2] == C[1][1] - C[1][2] == C[2][1] - C[2][2] +    and C[1][0] - C[0][0] == C[1][1] - C[0][1] == C[1][2] - C[0][2] +    and C[2][0] - C[1][0] == C[2][1] - C[1][1] == C[2][2] - C[1][2]