def main():

    A = [[int(i) for i in input().split()] for j in range(3)]

    from itertools import product

    for a1, a2, a3 in product(range(101), repeat=3):

        c1 = A[0][0] - a1 == A[1][0] - a2 == A[2][0] - a3

        c2 = A[0][1] - a1 == A[1][1] - a2 == A[2][1] - a3

        c3 = A[0][2] - a1 == A[1][2] - a2 == A[2][2] - a3

        if c1 and c2 and c3:

            return print("Yes")

    print("No")





if __name__ == '__main__':

    main()

def main():

    A = [[int(i) for i in input().split()] for j in range(3)]

    for i in range(1, 3):

        for j in range(3):

            A[i][j] -= A[0][j]

    if (A[1][0] == A[1][1] == A[1][2]) and (A[2][0] == A[2][1] == A[2][2]):

        print("Yes")

    else:

        print("No")





if __name__ == '__main__':

    main()

def main():
    A = [[int(i) for i in input().split()] for j in range(3)]
    from itertools import product

    for a1, a2, a3 in product(range(101), repeat=3):
        c1 = A[0][0] - a1 == A[1][0] - a2 == A[2][0] - a3
        c2 = A[0][1] - a1 == A[1][1] - a2 == A[2][1] - a3
        c3 = A[0][2] - a1 == A[1][2] - a2 == A[2][2] - a3
        if c1 and c2 and c3:
            return print("Yes")
    print("No")


if __name__ == "__main__":
    main()

def main():
    A = [[int(i) for i in input().split()] for j in range(3)]
    for i in range(1, 3):
        for j in range(3):
            A[i][j] -= A[0][j]
    if (A[1][0] == A[1][1] == A[1][2]) and (A[2][0] == A[2][1] == A[2][2]):
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()

-    from itertools import product - -    for a1, a2, a3 in product(range(101), repeat=3): -        c1 = A[0][0] - a1 == A[1][0] - a2 == A[2][0] - a3 -        c2 = A[0][1] - a1 == A[1][1] - a2 == A[2][1] - a3 -        c3 = A[0][2] - a1 == A[1][2] - a2 == A[2][2] - a3 -        if c1 and c2 and c3: -            return print("Yes") -    print("No") +    for i in range(1, 3): +        for j in range(3): +            A[i][j] -= A[0][j] +    if (A[1][0] == A[1][1] == A[1][2]) and (A[2][0] == A[2][1] == A[2][2]): +        print("Yes") +    else: +        print("No")