from sys import stdin

from itertools import combinations

from math import factorial

import numpy as np



li = [list(map(int,stdin.readline().rstrip().split())) for _ in range(3)]



a1 = 0

b1 = li[0][0]-a1

b2 = li[0][1]-a1

b3 = li[0][2]-a1

a2 = li[1][0]-b1

a3 = li[2][0]-b1



lin = [[a1,a2,a3],[b1,b2,b3]]



for i in range(3):

    for j in range(3):

        if li[i][j] != lin[0][i]+lin[1][j]:

            print("No")

            exit()



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

a = [0]*3

b = [0]*3

b[0] = c[0][0]

b[1] = c[0][1]

b[2] = c[0][2]

a[1] = c[1][1]-b[1]

a[2] = c[2][2]-b[2]



for i in range(3):

    for j in range(3):

        if c[i][j] != a[i]+b[j]:

            print("No")

            exit()

print("Yes")
from sys import stdin
from itertools import combinations
from math import factorial
import numpy as np

li = [list(map(int, stdin.readline().rstrip().split())) for _ in range(3)]
a1 = 0
b1 = li[0][0] - a1
b2 = li[0][1] - a1
b3 = li[0][2] - a1
a2 = li[1][0] - b1
a3 = li[2][0] - b1
lin = [[a1, a2, a3], [b1, b2, b3]]
for i in range(3):
    for j in range(3):
        if li[i][j] != lin[0][i] + lin[1][j]:
            print("No")
            exit()
print("Yes")

c = [list(map(int, input().split())) for i in range(3)]
a = [0] * 3
b = [0] * 3
b[0] = c[0][0]
b[1] = c[0][1]
b[2] = c[0][2]
a[1] = c[1][1] - b[1]
a[2] = c[2][2] - b[2]
for i in range(3):
    for j in range(3):
        if c[i][j] != a[i] + b[j]:
            print("No")
            exit()
print("Yes")

-from sys import stdin -from itertools import combinations -from math import factorial -import numpy as np - -li = [list(map(int, stdin.readline().rstrip().split())) for _ in range(3)] -a1 = 0 -b1 = li[0][0] - a1 -b2 = li[0][1] - a1 -b3 = li[0][2] - a1 -a2 = li[1][0] - b1 -a3 = li[2][0] - b1 -lin = [[a1, a2, a3], [b1, b2, b3]] +c = [list(map(int, input().split())) for i in range(3)] +a = [0] * 3 +b = [0] * 3 +b[0] = c[0][0] +b[1] = c[0][1] +b[2] = c[0][2] +a[1] = c[1][1] - b[1] +a[2] = c[2][2] - b[2] -        if li[i][j] != lin[0][i] + lin[1][j]: +        if c[i][j] != a[i] + b[j]: