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

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

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

    print("Yes")

else:

    print("No")

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

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

    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")

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

C = [list(map(int, input().split())) for _ in range(3)]
if (
    C[0][1] - C[0][0] == C[1][1] - C[1][0] == C[2][1] - C[2][0]
    and C[0][2] - C[0][1] == C[1][2] - C[1][1] == C[2][2] - C[2][1]
    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")

-    C[1][0] - C[0][0] == C[1][1] - C[0][1] == C[1][2] - C[0][2] -    and C[2][0] - C[0][0] == C[2][1] - C[0][1] == C[2][2] - C[0][2] -    and C[0][1] - C[0][0] == C[1][1] - C[1][0] == C[2][1] - C[2][0] -    and C[0][2] - C[0][0] == C[1][2] - C[1][0] == C[2][2] - C[2][0] +    C[0][1] - C[0][0] == C[1][1] - C[1][0] == C[2][1] - C[2][0] +    and C[0][2] - C[0][1] == C[1][2] - C[1][1] == C[2][2] - C[2][1] +    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]