We have a 3 \times 3 grid. A number c_{i, j} is written in the square (i, j), where (i, j) denotes the square at the i-th row from the top and the j-th column from the left.   According to Takahashi, there are six integers a_1, a_2, a_3, b_1, b_2, b_3 whose values are fixed, and the number written in the square (i, j) is equal to a_i + b_j.   Determine if he is correct.
c=[list(map(int,input().split()))for i in range(3)]
x=[0]*3
y=[0]*3
for i in range(3):
    x[i]=c[i][0]-y[0]
    for j in range(3):
        y[i]=c[i][0]-x[0]
judge=True
for i in range(3):
    for j in range(3):
        if c[i][j]!=x[i]+y[j]:
            judge=False
if judge:
    print("Yes")
else:
    print("No")

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