def main():

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

    N = 100

    for i in range(-N, N+1):

        for j in range(-N, N+1):

            for k in range(-N, N+1):

                if c[0][0] - i == c[0][1] - j == c[0][2] - k:

                    if c[1][0] - i == c[1][1] - j == c[1][2] - k:

                        if c[2][0] - i == c[2][1] - j == c[2][2] - k:

                            print('Yes')

                            return

    print('No')

main()
a, b, c = list(map(int, input().split()))

d, e, f = list(map(int, input().split()))

g, h, i = list(map(int, input().split()))

if a - b == d - e == g - h and b - c == e - f == h - i:

    print('Yes')

else:

    print('No')
def main():
    c = [list(map(int, input().split())) for _ in range(3)]
    N = 100
    for i in range(-N, N + 1):
        for j in range(-N, N + 1):
            for k in range(-N, N + 1):
                if c[0][0] - i == c[0][1] - j == c[0][2] - k:
                    if c[1][0] - i == c[1][1] - j == c[1][2] - k:
                        if c[2][0] - i == c[2][1] - j == c[2][2] - k:
                            print("Yes")
                            return
    print("No")


main()

a, b, c = list(map(int, input().split()))
d, e, f = list(map(int, input().split()))
g, h, i = list(map(int, input().split()))
if a - b == d - e == g - h and b - c == e - f == h - i:
    print("Yes")
else:
    print("No")

-def main(): -    c = [list(map(int, input().split())) for _ in range(3)] -    N = 100 -    for i in range(-N, N + 1): -        for j in range(-N, N + 1): -            for k in range(-N, N + 1): -                if c[0][0] - i == c[0][1] - j == c[0][2] - k: -                    if c[1][0] - i == c[1][1] - j == c[1][2] - k: -                        if c[2][0] - i == c[2][1] - j == c[2][2] - k: -                            print("Yes") -                            return +a, b, c = list(map(int, input().split())) +d, e, f = list(map(int, input().split())) +g, h, i = list(map(int, input().split())) +if a - b == d - e == g - h and b - c == e - f == h - i: +    print("Yes") +else: - - -main()