def calc(a1,c):

    As=[a1]

    Bs=[]

    Bs.append(c[0][0]-As[0])

    As.append(c[1][0]-Bs[0])

    As.append(c[2][0]-Bs[0])

    Bs.append(c[0][1]-As[0])

    Bs.append(c[0][2]-As[0])

    for a in range(3):

        for b in range(3):

            if As[a]+Bs[b]!=c[a][b]: return False

    return True



c=[]

for i in range(3):

    c.append(list(map(int,input().split())))



flag=False

for i in range(-int(1e4),100):

    if (calc(i,c)): 

        print('Yes')

        flag=True

        break

if not flag: print('No')
def calc(a1,c):

    As=[a1]

    Bs=[]

    Bs.append(c[0][0]-As[0])

    As.append(c[1][0]-Bs[0])

    As.append(c[2][0]-Bs[0])

    Bs.append(c[0][1]-As[0])

    Bs.append(c[0][2]-As[0])

    for a in range(3):

        for b in range(3):

            if As[a]+Bs[b]!=c[a][b]: return False

    return True



c=[]

for i in range(3):

    c.append(list(map(int,input().split())))



flag=False

if (calc(0,c)): 

    print('Yes')

else: print('No')
def calc(a1, c):
    As = [a1]
    Bs = []
    Bs.append(c[0][0] - As[0])
    As.append(c[1][0] - Bs[0])
    As.append(c[2][0] - Bs[0])
    Bs.append(c[0][1] - As[0])
    Bs.append(c[0][2] - As[0])
    for a in range(3):
        for b in range(3):
            if As[a] + Bs[b] != c[a][b]:
                return False
    return True


c = []
for i in range(3):
    c.append(list(map(int, input().split())))
flag = False
for i in range(-int(1e4), 100):
    if calc(i, c):
        print("Yes")
        flag = True
        break
if not flag:
    print("No")

def calc(a1, c):
    As = [a1]
    Bs = []
    Bs.append(c[0][0] - As[0])
    As.append(c[1][0] - Bs[0])
    As.append(c[2][0] - Bs[0])
    Bs.append(c[0][1] - As[0])
    Bs.append(c[0][2] - As[0])
    for a in range(3):
        for b in range(3):
            if As[a] + Bs[b] != c[a][b]:
                return False
    return True


c = []
for i in range(3):
    c.append(list(map(int, input().split())))
flag = False
if calc(0, c):
    print("Yes")
else:
    print("No")

-for i in range(-int(1e4), 100): -    if calc(i, c): -        print("Yes") -        flag = True -        break -if not flag: +if calc(0, c): +    print("Yes") +else: