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

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

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



for a1 in range(101):

    b1 = [l1[0]-a1, l1[1]-a1, l1[2]-a1]

    for a2 in range(101):

        b2 = [l2[0] - a2, l2[1] - a2, l2[2] - a2]

        for a3 in range(101):

            b3 = [l3[0] - a3, l3[1] - a3, l3[2] - a3]

            if b1 == b2 == b3:

                print("Yes")

                exit()

else:

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



for a1 in range(101):

    for a2 in range(101):

        for a3 in range(101):

            if (c[0][0] - a1 == c[1][0] - a2 == c[2][0] - a3) and (c[0][1] - a1 == c[1][1] - a2 == c[2][1] - a3) and (c[0][2] - a1 == c[1][2] - a2 == c[2][2] - a3):

                print("Yes")

                exit()

else:

    print("No")

l1 = list(map(int, input().split()))
l2 = list(map(int, input().split()))
l3 = list(map(int, input().split()))
for a1 in range(101):
    b1 = [l1[0] - a1, l1[1] - a1, l1[2] - a1]
    for a2 in range(101):
        b2 = [l2[0] - a2, l2[1] - a2, l2[2] - a2]
        for a3 in range(101):
            b3 = [l3[0] - a3, l3[1] - a3, l3[2] - a3]
            if b1 == b2 == b3:
                print("Yes")
                exit()
else:
    print("No")

c = [list(map(int, input().split())) for i in range(3)]
for a1 in range(101):
    for a2 in range(101):
        for a3 in range(101):
            if (
                (c[0][0] - a1 == c[1][0] - a2 == c[2][0] - a3)
                and (c[0][1] - a1 == c[1][1] - a2 == c[2][1] - a3)
                and (c[0][2] - a1 == c[1][2] - a2 == c[2][2] - a3)
            ):
                print("Yes")
                exit()
else:
    print("No")

-l1 = list(map(int, input().split())) -l2 = list(map(int, input().split())) -l3 = list(map(int, input().split())) +c = [list(map(int, input().split())) for i in range(3)] -    b1 = [l1[0] - a1, l1[1] - a1, l1[2] - a1] -        b2 = [l2[0] - a2, l2[1] - a2, l2[2] - a2] -            b3 = [l3[0] - a3, l3[1] - a3, l3[2] - a3] -            if b1 == b2 == b3: +            if ( +                (c[0][0] - a1 == c[1][0] - a2 == c[2][0] - a3) +                and (c[0][1] - a1 == c[1][1] - a2 == c[2][1] - a3) +                and (c[0][2] - a1 == c[1][2] - a2 == c[2][2] - a3) +            ):