import sys



def solve():

    input = sys.stdin.readline

    C = [[int(c) for c in input().split()] for _ in range(3)]

    possible = False

    for i in range(101):

        for j in range(101):

            for k in range(101):

                a11 = C[0][0] - i

                a12 = C[0][1] - j

                a13 = C[0][2] - k

                a21 = C[1][0] - i

                a22 = C[1][1] - j

                a23 = C[1][2] - k

                a31 = C[2][0] - i

                a32 = C[2][1] - j

                a33 = C[2][2] - k

                if a11 == a12 == a13 and a21 == a22 == a23 and a31 == a32 == a33:

                    possible = True

                    break

            if possible: break

        if possible: break

    print(("Yes" if possible else "No"))



    return 0



if __name__ == "__main__":

    solve()
def solve():

    C = [[int(c) for c in input().split()] for _ in range(3)]

    diffr1 = C[0][1] - C[0][0]

    diffr2 = C[0][2] - C[0][1]

    diffc1 = C[1][0] - C[0][0]

    diffc2 = C[2][0] - C[1][0]

    if C[1][1] - C[1][0] == C[2][1] - C[2][0] == diffr1:

        if C[1][2] - C[1][1] == C[2][2] - C[2][1] == diffr2:

            if C[1][1]  - C[0][1] == C[1][2] - C[0][2] == diffc1:

                if C[2][1] - C[1][1] == C[2][2] - C[1][2] == diffc2:

                    return "Yes"

    return "No"



if __name__ == "__main__":

    print((solve()))
import sys


def solve():
    input = sys.stdin.readline
    C = [[int(c) for c in input().split()] for _ in range(3)]
    possible = False
    for i in range(101):
        for j in range(101):
            for k in range(101):
                a11 = C[0][0] - i
                a12 = C[0][1] - j
                a13 = C[0][2] - k
                a21 = C[1][0] - i
                a22 = C[1][1] - j
                a23 = C[1][2] - k
                a31 = C[2][0] - i
                a32 = C[2][1] - j
                a33 = C[2][2] - k
                if a11 == a12 == a13 and a21 == a22 == a23 and a31 == a32 == a33:
                    possible = True
                    break
            if possible:
                break
        if possible:
            break
    print(("Yes" if possible else "No"))
    return 0


if __name__ == "__main__":
    solve()

def solve():
    C = [[int(c) for c in input().split()] for _ in range(3)]
    diffr1 = C[0][1] - C[0][0]
    diffr2 = C[0][2] - C[0][1]
    diffc1 = C[1][0] - C[0][0]
    diffc2 = C[2][0] - C[1][0]
    if C[1][1] - C[1][0] == C[2][1] - C[2][0] == diffr1:
        if C[1][2] - C[1][1] == C[2][2] - C[2][1] == diffr2:
            if C[1][1] - C[0][1] == C[1][2] - C[0][2] == diffc1:
                if C[2][1] - C[1][1] == C[2][2] - C[1][2] == diffc2:
                    return "Yes"
    return "No"


if __name__ == "__main__":
    print((solve()))

-import sys - - -    input = sys.stdin.readline -    possible = False -    for i in range(101): -        for j in range(101): -            for k in range(101): -                a11 = C[0][0] - i -                a12 = C[0][1] - j -                a13 = C[0][2] - k -                a21 = C[1][0] - i -                a22 = C[1][1] - j -                a23 = C[1][2] - k -                a31 = C[2][0] - i -                a32 = C[2][1] - j -                a33 = C[2][2] - k -                if a11 == a12 == a13 and a21 == a22 == a23 and a31 == a32 == a33: -                    possible = True -                    break -            if possible: -                break -        if possible: -            break -    print(("Yes" if possible else "No")) -    return 0 +    diffr1 = C[0][1] - C[0][0] +    diffr2 = C[0][2] - C[0][1] +    diffc1 = C[1][0] - C[0][0] +    diffc2 = C[2][0] - C[1][0] +    if C[1][1] - C[1][0] == C[2][1] - C[2][0] == diffr1: +        if C[1][2] - C[1][1] == C[2][2] - C[2][1] == diffr2: +            if C[1][1] - C[0][1] == C[1][2] - C[0][2] == diffc1: +                if C[2][1] - C[1][1] == C[2][2] - C[1][2] == diffc2: +                    return "Yes" +    return "No" -    solve() +    print((solve()))