CodeEff/ECCO huggingface dataset:
# Original solution
l=[]
for i in range(3):
  l1=list(map(int,input().split()))
  l.append(l1)
flag=0
for i in range(-1000,1000,):
  y0=l[0][0]-i
  y1=l[1][0]-i
  y2=l[2][0]-i
  x1=l[0][1]-y0
  x2=l[0][2]-y0
  if l[1][1]==y1+x1 and l[1][2]==y1+x2 and l[2][1]==y2+x1 and l[2][2]==y2+x2:
    flag=1
  else:
    continue
if flag==1:
  print('Yes')
else:
  print('No')

# Optimized solution
l=[]
for i in range(3):
  l1=list(map(int,input().split()))
  l.append(l1)
flag=0
y0=l[0][0]-0
y1=l[1][0]-0
y2=l[2][0]-0
x1=l[0][1]-y0
x2=l[0][2]-y0
if l[1][1]==y1+x1 and l[1][2]==y1+x2 and l[2][1]==y2+x1 and l[2][2]==y2+x2:
    flag=1
else:
    pass
if flag==1:
  print('Yes')
else:
  print('No')
# Original solution
c = []
for i in range(3):
    c.append(list(map(int,input().split())))
"""
変数6個で解9個
b1-b2 : c*1-c*2
b2-b3 : c*2-c*3 
b3-b1 : c*3-c*1
a1-a2 : c1*-c2* 
a2-a3 : c2*-c3*
a3-a1 : c3*-c1*
"""

i = 0
flaga12 = True
flaga23 = True 
flaga31 = True
flagb12 = True
flagb23 = True 
flagb31 = True

b12 = c[i][0]-c[i][1]
b23 = c[i][1]-c[i][2]
b31 = c[i][2]-c[i][0]

for i in range(3):
    flagb12 = flagb12 and (b12 == c[i][0]-c[i][1])
    flagb23 = flagb23 and (b23 == c[i][1]-c[i][2])
    flagb31 = flagb31 and (b31 == c[i][2]-c[i][0])
    
j = 0
a12 = c[0][j]-c[1][j]
a23 = c[1][j]-c[2][j]
a31 = c[2][j]-c[0][j]
for i in range(3):
    a12 = c[0][j]-c[1][j]
    a23 = c[1][j]-c[2][j]
    a31 = c[2][j]-c[0][j]
    flaga12 = flaga12 and (a12 == c[0][j]-c[1][j])
    flaga23 = flaga23 and (a23 == c[1][j]-c[2][j])
    flaga31 = flaga31 and (a31 == c[2][j]-c[0][j])

judge = (flaga12 and flaga23 and flaga31 and flagb12 and flagb23 and flagb31)
if judge:
    print("Yes")
else:
    print("No")

# Optimized solution
f = []
for i in range(3):
    f.append(list(map(int, input().split())))
"""
a1+a2+a3+b1+b2+b3が3通りで合うか
"""
s1 = f[0][0] + f[1][1] + f[2][2]
s2 = f[0][1] + f[1][2] + f[2][0]
s3 = f[0][2] + f[1][0] + f[2][1]

if s1==s2==s3:
    print("Yes")
else:
    print("No")
# Original solution
c = [list(map(int, input().split())) for _ in range(3)]
if 2*c[0][2]-c[1][2]-c[2][2]+c[1][0]+c[2][0] == 2*c[0][0]:
  if 2*c[1][0]-c[2][0]-c[0][0]+c[2][1]+c[0][1] == 2*c[1][1]:
    if 2*c[2][1]-c[0][1]-c[1][1]+c[0][2]+c[1][2] == 2*c[2][2]:
      print('Yes')
    else:
      print('No')
  else:
    print('No')
else:
  print('No')

# Optimized solution
c = []
for i in range(3):
  c_ = list(map(int, input().split()))
  c.append(c_)
  
if c[2][2] == c[0][2] + c[2][0] -c[0][0] and c[2][2] == c[1][2] + c[2][1] -c[1][1] and c[1][1] == c[0][1] + c[1][0] -c[0][0]:
  print('Yes')
else:
  print('No')
# Original solution
c = [list(map(int, input().split())) for i in range(3)]

res = 0
ans = 0

for i in range(3):
  res += sum(c[i])
  ans += c[i][i]*3
  
if res == ans:
  print('Yes')
else:
  print('No')

# Optimized solution
c=[list(map(int,input().split())) for i in range(3)]
if (c[0][0]+c[1][1]+c[2][2])*2==c[0][1]+c[0][2]+c[1][0]+c[1][2]+c[2][0]+c[2][1]:
  print('Yes')
else:
  print('No')
# Original solution
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"


def solve():
    C = []
    for _ in range(3):
        C.append(list(map(int, input().split())))

    for a1 in range(0, 101):
        for a2 in range(0, 101):
            for a3 in range(0, 101):

                b1_ok = (C[0][0] - a1) == (C[1][0] - a2) == (C[2][0] - a3)
                b2_ok = (C[0][1] - a1) == (C[1][1] - a2) == (C[2][1] - a3)
                b3_ok = (C[0][2] - a1) == (C[1][2] - a2) == (C[2][2] - a3)

                if b1_ok and b2_ok and b3_ok:
                    return Yes

    return No


def main():
    print((solve()))


if __name__ == '__main__':
    main()


# Optimized solution
#!/usr/bin/python3

from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W

def ok(a1, c):
    b1 = c[0][0] - a1
    b2 = c[0][1] - a1
    b3 = c[0][2] - a1

    if len(set([c[1][0] - b1,  c[1][1] - b2,  c[1][2] - b3])) != 1:
        return False
    if len(set([c[2][0] - b1, c[2][1] - b2, c[2][2] - b3])) != 1:
        return False

    return True

def main():
    c = []
    for _ in range(3):
        c.append(list(map(int, input().split())))

    for a1 in range(101):
        if ok(a1, c):
            print(Yes)
            return
    print(No)

if __name__ == '__main__':
    main()
# Original solution
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()

# Optimized solution
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()))
# Original solution
import sys
input = sys.stdin.readline

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

for i in range(101):
    for j in range(101):
        for k in range(101):
            b1, b2, b3 = [x - i for x in c[0]]
            if [b1 + j, b2 + j, b3 + j] == c[1] and [b1 + k, b2 + k, b3 + k] == c[2]:
                print("Yes")
                sys.exit()
print("No")



# Optimized solution
import sys
input = lambda: sys.stdin.readline().rstrip("\r\n")

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

flag = 1

for a1 in range(101):
    for a2 in range(101):
        for a3 in range(101):
            if c[0][0] - a1 == c[1][0] - a2 and c[1][0] - a2 == c[2][0] - a3:
                if c[0][1] - a1 == c[1][1] - a2 and c[1][1] - a2 == c[2][1] - a3:
                    if c[0][2] - a1 == c[1][2] - a2 and c[1][2] - a2 == c[2][2] - a3:
                        flag = 0

if flag:
    print('No')
else:
    print('Yes')
# Original solution
c11,c12,c13 = list(map(int,input().split()))
c21,c22,c23 = list(map(int,input().split()))
c31,c32,c33 = list(map(int,input().split()))
count = 0
if c21 - c11 == c22 - c12 == c23 - c13:
  count += 1
if c31 - c21 == c32 - c22 == c33 - c23:
  count += 1
if c12 - c11 == c22 - c21 == c32 - c31:
  count += 1
if c13 - c12 == c23 - c22 == c33 - c32:
  count += 1
if count == 4:
  print("Yes")
else:
  print("No")

# Optimized solution
c11,c12,c13 = list(map(int,input().split()))
c21,c22,c23 = list(map(int,input().split()))
c31,c32,c33 = list(map(int,input().split()))
count = 0
if c11-c12 == c21-c22 == c31-c32:
  count += 1
  if c12-c13 == c22-c23 == c32-c33:
    count += 1
    if c21-c11 == c22-c12 == c23-c13:
      count += 1
      if c21-c31 == c22-c32 == c23-c33:
        count += 1
if count == 4:
  print("Yes")
else:
  print("No")
# Original solution
c = [list(map(int, input().split())) for _ in range(3)]
ok = False
for a1 in range(101):
    for a2 in range(101):
        for a3 in range(101):
            b1 = c[0][0] - a1
            b2 = c[0][1] - a1
            b3 = c[0][2] - a1

            a = [a1, a2, a3]
            b = [b1, b2, b3]
            ok_sub = True
            for i in range(3):
                for j in range(3):
                    if a[i] + b[j] != c[i][j]:
                        ok_sub = False
            if ok_sub:
                ok = True

print('Yes') if ok else print('No')


# Optimized solution
c = [list(map(int, input().split())) for _ in range(3)]
ok = True

b = [c[0][0], c[0][1], c[0][2]]
a = [0, c[1][0] - b[0], c[2][0] - b[0]]

for i in range(3):
    for j in range(3):
        if a[i] + b[j] != c[i][j]:
            ok = False

print('Yes') if ok else print('No')
# Original solution
l1 = list(map(int, input().split()))
l2 = list(map(int, input().split()))
l3 = list(map(int, input().split()))

for a1 in range(101):
    b1 = [l1[0]-a1, l1[1]-a1, l1[2]-a1]
    for a2 in range(101):
        b2 = [l2[0] - a2, l2[1] - a2, l2[2] - a2]
        for a3 in range(101):
            b3 = [l3[0] - a3, l3[1] - a3, l3[2] - a3]
            if b1 == b2 == b3:
                print("Yes")
                exit()
else:
    print("No")

# Optimized solution
c = [list(map(int, input().split())) for i in range(3)]

for a1 in range(101):
    for a2 in range(101):
        for a3 in range(101):
            if (c[0][0] - a1 == c[1][0] - a2 == c[2][0] - a3) and (c[0][1] - a1 == c[1][1] - a2 == c[2][1] - a3) and (c[0][2] - a1 == c[1][2] - a2 == c[2][2] - a3):
                print("Yes")
                exit()
else:
    print("No")
# Original solution
c = [list(map(int, input().split())) for i in range(3)]

for a1 in range(101):
    for a2 in range(101):
        for a3 in range(101):
            if (c[0][0] - a1 == c[1][0] - a2 == c[2][0] - a3) and (c[0][1] - a1 == c[1][1] - a2 == c[2][1] - a3) and (c[0][2] - a1 == c[1][2] - a2 == c[2][2] - a3):
                print("Yes")
                exit()
else:
    print("No")


# Optimized solution
c1 = list(map(int, input().split()))
c2 = list(map(int, input().split()))
c3 = list(map(int, input().split()))

for b1 in range(101):
    for b2 in range(101):
        for b3 in range(101):
            if c1[0] - b1 == c1[1] - b2 == c1[2] - b3:
                if c2[0] - b1 == c2[1] - b2 == c2[2] - b3:
                    if c3[0] - b1 == c3[1] - b2 == c3[2] - b3:
                        print("Yes")
                        exit()
else:
    print("No")
# Original solution
c = []
for _ in range(3):
    c.append([int(i) for i in input().split()])

def validate(a, b, c):
    for i in range(3):
        for j in range(3):
            if c[i][j] != a[i] + b[j]:
                return False
    return True

found = False
min_b1 = min(c[0][0], c[1][0], c[2][0])
for b1 in range(min_b1 + 1):
    a = [c[0][0] - b1, c[1][0] - b1, c[2][0] - b1]
    b2s = [c[0][1] - a[0], c[1][1] - a[1], c[2][1] - a[2]]
    if b2s[0] != b2s[1] or b2s[0] != b2s[2]:
        continue
    b3s = [c[0][2] - a[0], c[1][2] - a[1], c[2][2] - a[2]]
    if b3s[0] != b3s[1] or b3s[0] != b3s[2]:
        continue
    b = [b1, b2s[0], b3s[0]]
    if not validate(a, b, c):
        continue
    found = True
    break

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

# Optimized solution
c = [list(map(int, input().split())) for _ in range(3)]

for i in range(2):
    for j in range(2):
        d = c[i][j] - c[i+1][j]
        e = c[i][j+1] - c[i+1][j+1]
        if d != e:
            print("No")
            exit(0)

for i in range(2):
    for j in range(2):
        d = c[i][j] - c[i][j+1]
        e = c[i+1][j] - c[i+1][j+1]
        if d != e:
            print("No")
            exit(0)

print("Yes")
# Original solution
# ABC 088 C

from collections import deque

def resolve():
    def all_same(a, b, c):
        if a ==b and b ==c:
            return True
        return False

    c = []
    for _ in range(3):
        c.append(list(map(int, input().split())))
    ans = True

    if not all_same(c[0][0]-c[1][0], c[0][1] - c[1][1], c[0][2]-c[1][2]):
        ans = False
    if not all_same(c[0][0]-c[2][0], c[0][1] - c[2][1], c[0][2]-c[2][2]):
        ans = False
    if not all_same(c[0][0] - c[0][1], c[1][0] - c[1][1], c[2][0] - c[2][1]):
        ans = False
    if not all_same(c[0][0] - c[0][2], c[1][0] - c[1][2], c[2][0] - c[2][2]):
        ans = False

    if ans:
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    resolve()


# Optimized solution
def resolve():
  c = []
  c.append(list(map(int, input().split())))
  c.append(list(map(int, input().split())))
  c.append(list(map(int, input().split())))
  a01 = c[0][0] - c[0][1]
  a02 = c[0][0] - c[0][2]
  a12 = c[0][1] - c[0][2]
  b01 = c[0][0] - c[1][0]
  b02 = c[0][0] - c[2][0]
  b12 = c[1][0] - c[2][0]
  for i in range(3):
    if ((c[i][0] - c[i][1]) != a01) or (c[i][0] - c[i][2] != a02) or (c[i][1] - c[i][2] != a12):
      return False
    if ((c[0][i] - c[1][i]) != b01 or (c[0][i] - c[2][i]) != b02 or (c[1][i] - c[2][i]) != b12):
      return False

  return True

if __name__ == "__main__":
  if (resolve()):
    print("Yes")
  else:
    print("No")
# Original solution
c1 = list(map(int,input().split()))
c2 = list(map(int,input().split()))
c3 = list(map(int,input().split()))
if not c1[0]-c1[1] == c2[0]-c2[1] == c3[0]-c3[1]:
    print('No')
    exit()
if not c1[2]-c1[1] == c2[2]-c2[1] == c3[2]-c3[1]:
    print('No')
    exit()
if not c1[0]-c2[0] == c1[1]-c2[1] == c1[2]-c2[2]:
    print('No')
    exit()
if not c3[0]-c2[0] == c3[1]-c2[1] == c3[2]-c2[2]:
    print('No')
    exit()
print('Yes')

# Optimized solution
a1,a2,a3 = list(map(int,input().split()))
b1,b2,b3 = list(map(int,input().split()))
c1,c2,c3 = list(map(int,input().split()))

if not (a1-a2 == b1-b2 == c1-c2) or not (a2-a3 == b2-b3 == c2-c3):
    print('No')
elif not (a1-b1 == a2-b2 == a3-b3) or not (b1-c1 == b2-c2 == b3-c3):
    print('No')
else:
    print('Yes')
# Original solution
C = [list(map(int, input().split())) for _ in range(3)]
a = [0] * 3
b = [0] * 3
for i in range(101):
    a[0] = i
    flg = True
    for j in range(3):
        b[j] = C[0][j] - i
        if b[j] < 0:
            flg = False
            break
    if flg:
        for j in range(1, 3):
            a[j] = C[j][0] - b[0]
            if a[j] < 0:
                flg = False
                break
    if flg:
        for j in range(3):
            for k in range(3):
                if C[j][k] != a[j] + b[k]:
                    flg = False
                    break
        if flg:
            print('Yes')
            quit()
print('No')

# Optimized solution
C = [list(map(int, input().split())) for _ in range(3)]
a = [0] * 3
b = [0] * 3
flg = True
for j in range(3):
    b[j] = C[0][j] - a[0]

for j in range(1, 3):
    a[j] = C[j][0] - b[0]
for j in range(3):
    for k in range(3):
        if C[j][k] != a[j] + b[k]:
            flg = False
            break
if flg:
    print('Yes')
    quit()
print('No')
# Original solution
c = [[]]*3

for i in range(3):
    c[i] = list(map(int, input().split()))
ans = 0
for i in range(3):
    ans += sum(c[i])

if ans % 3 == 0:
    arr = [[0]* 6]*3
    for i in range(3):
        arr[i][0] = c[i][0] - c[i][1]
        arr[i][1] = c[i][0] - c[i][2]
        arr[i][2] = c[i][1] - c[i][0]
        arr[i][3] = c[i][1] - c[i][2]
        arr[i][4] = c[i][2] - c[i][0]
        arr[i][5] = c[i][2] - c[i][1]
    for i in range(6):
        if arr[0][i] == arr[1][i] and arr[0][i] == arr[2][i]:
            continue
        else:
            print("No")
            exit(0)

    for i in range(3):
        arr[i][0] = c[0][i] - c[1][i]
        arr[i][1] = c[0][i] - c[2][i]
        arr[i][2] = c[1][i] - c[0][i]
        arr[i][3] = c[1][i] - c[2][i]
        arr[i][4] = c[2][i] - c[1][i]
        arr[i][5] = c[2][i] - c[0][i]
          

    for i in range(6):
        if arr[0][i] == arr[1][i] and arr[0][i] == arr[2][i]:
            continue
        else:
            print("No")
            exit(0)

    arr = [0]*3
    sum = 0
    for i in range(3):
        arr[0] += c[i][i]
    for i in range(3):
        if i + 1 < 3:
            arr[1] += c[i][i+1]
        else:
            arr[1] += c[i][0]
    for i in range(3):
        if i + 2 < 3:
            arr[2] += c[i][i+2]
        else:
            arr[2] += c[i][i-1]
    
    if arr[0] != arr[1] or arr[0] != arr[2]:
        print("No")
        exit(0)

    print("Yes")
    exit(0)

print("No")

# Optimized solution
c = [[]]*3

for i in range(3):
    c[i] = list(map(int, input().split()))
ans = 0
for i in range(3):
    ans += sum(c[i])

if ans % 3 == 0:
    

    arr = [0]*3
    sum = 0
    for i in range(3):
        arr[0] += c[i][i]
    for i in range(3):
        if i + 1 < 3:
            arr[1] += c[i][i+1]
        else:
            arr[1] += c[i][0]
    for i in range(3):
        if i + 2 < 3:
            arr[2] += c[i][i+2]
        else:
            arr[2] += c[i][i-1]
    
    if arr[0] != arr[1] or arr[0] != arr[2]:
        print("No")
        exit(0)

    print("Yes")
    exit(0)

print("No")
# Original solution
import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
from collections import deque
def getN():
    return int(eval(input()))
def getList():
    return list(map(int, input().split()))
import math
import bisect
from logging import getLogger, StreamHandler, DEBUG, WARNING
logger = getLogger(__name__)
handler = StreamHandler()
handler.setLevel(DEBUG)
logger.setLevel(DEBUG)
# handler.setLevel(WARNING)
# logger.setLevel(WARNING)
logger.addHandler(handler)



# class SegTree():
#     def __init__(self, n):
#         self.value = [0 for i in range(n*2)]

# MOD = 10 ** 9 + 7

# def getinvmod(n):
#     return [pow(i, MOD-2, MOD) for i in range(n+1)]

def judge(a1, a2, a3, nums):
    b1 = nums[0][0] - a1
    b2 = nums[0][1] - a1
    b3 = nums[0][2] - a1
    if a2 + b1 == nums[1][0] and a2 + b2 == nums[1][1] and a2 + b3 == nums[1][2]:
        if a3 + b1 == nums[2][0] and a3 + b2 == nums[2][1] and a3 + b3 == nums[2][2]:
            return True

    return False

def main():
    nums = [getList() for _ in range(3)]
    for a1 in range(101):
        for a2 in range(101):
            for a3 in range(101):
                if judge(a1, a2, a3, nums):
                    print("Yes")
                    return

    print("No")

if __name__ == "__main__":
    main()

# Optimized solution
import sys
# input = sys.stdin.buffer.readline
def getN():
    return int(eval(input()))
def getNM():
    return list(map(int, input().split()))
def getlist():
    return list(map(int, input().split()))
import math
import bisect
import heapq
from collections import defaultdict, Counter, deque
MOD = 10**9 + 7
INF = 10**15

def main():
    a,b,c = getlist()
    s12 = b - a
    s13 = c - a
    s23 = c - b
    for i in range(2):
        d,e,f = getlist()
        # print(d,e,f)
        # print(s12,s23,s13)
        if e-d != s12:
            # print(e-d)
            print("No")
            return
        if f-d != s13:
            print("No")
            return
        if f-e != s23:
            print("No")
            return

    print("Yes")
    return

if __name__ == '__main__':
    main()

"""
9999
3

2916
"""
# Original solution
c = [list(map(int,input().split())) for _ in range(3)]
for i in range(2):
    x = c[0][i] - c[0][i+1]
    y = c[1][i] - c[1][i+1]
    z = c[2][i] - c[2][i+1]
    if not (x==y and y==z and z==x):
        print('No')
        exit()
for i in range(2):
    x = c[i][0] - c[i+1][0]
    y = c[i][1] - c[i+1][1]
    z = c[i][2] - c[i+1][2]
    if not (x==y and y==z and z==x):
        print('No')
        exit()
print('Yes')


# Optimized solution
l = [list(map(int,input().split())) for _ in range(3)]
m = [[0, 0, 0] for _ in range(3)]

for i in range(3):
    for j in range(3):
        m[i][j] = l[i][j] - l[0][j]

for i in range(3):
    f = True
    for j in range(3):
        if m[i][j] != m[i][0]:
            f = False
            break
    if not f:
        print('No')
        exit()

print('Yes')
# Original solution
C = [list(map(int,input().split())) for _ in range(3)]

b = [0]*3
for i in range(3):
  b[i] = C[0][i]-0
a = [0]*3
for i in range(3):
  a[i] = C[i][0] - b[0]
ans = "Yes"
for i in range(3):
  for j in range(3):
    if(C[i][j] != a[i] + b[j]):
      ans = "No"
print(ans)

# Optimized solution
C = [list(map(int,input().split())) for _ in range(3)]
#a1 = 0 と固定
b = []
for i in range(3):
  b.append(C[0][i] - 0)
a = []
for i in range(3):
  a.append(C[i][0] - b[0])
ans = "Yes"
for i in range(3):
  for j in range(3):
    if(C[i][j] != a[i] + b[j]):
      ans = "No"
print(ans)
# Original solution
# -*- coding: utf-8 -*-

def solve():
    c = [list(map(int, input().split())) for _ in range(3)]
    for a0 in range(-100, 101) :
        b = [c[0][i] - a0 for i in range(3)]
        if any(c[1][0] - b[0] != c[1][i] - b[i] for i in range(3)):
            continue
        if any(c[2][0] - b[0] != c[2][i] - b[i] for i in range(3)):
            continue
        return True


if __name__ == '__main__':
    if solve() :
        print("Yes")
    else :
        print("No")


# Optimized solution
# -*- coding: utf-8 -*-

def solve():
    c = [list(map(int, input().split())) for _ in range(3)]
    for a0 in range(-100, 101) :
        b = [c[0][i] - a0 for i in range(3)]
        if any(c[1][0] - b[0] != c[1][i] - b[i] for i in range(3)):
            continue
        if any(c[2][0] - b[0] != c[2][i] - b[i] for i in range(3)):
            continue
        return True
    return False


if solve() :
    print("Yes")
else :
    print("No")
# Original solution
c=[[int(x) for x in input().split()] for _ in range(3)]
ans="No"
for a1 in c[0]:
    for a2 in c[1]:
        for a3 in c[2]:
            b1=c[0][0]-a1
            b2=c[1][1]-a2
            b3=c[2][2]-a3
            if a1+b2==c[0][1] and a1+b3==c[0][2] and a2+b1==c[1][0] and a2+b3==c[1][2] and a3+b1==c[2][0] and a3+b2==c[2][1]:
                ans = "Yes"
                break
        if ans=="Yes":break
    if ans=="Yes":break
print(ans)

# Optimized solution
c=[[int(x) for x in input().split()] for _ in range(3)]
ans="No"
for a1 in c[0]:
    for a2 in c[1]:
        for a3 in c[2]:
            b1=c[0][0]-a1
            b2=c[1][1]-a2
            b3=c[2][2]-a3
            if a1+b2==c[0][1] and a1+b3==c[0][2] and a2+b1==c[1][0] and a2+b3==c[1][2] and a3+b1==c[2][0] and a3+b2==c[2][1]:
                ans = "Yes"
                break
print(ans)
# Original solution
c = []
for i in range(3):
    c.append(list(map(int, input().split())))

ans = 'Yes'

for i in range(2):
    a0 = c[0][i] - c[0][i + 1]
    a1 = c[1][i] - c[1][i + 1]
    a2 = c[2][i] - c[2][i + 1]
    if not (a0 == a1 == a2):
        ans = 'No'
        break

print(ans)

# Optimized solution
c = [list(map(int, input().split())) for i in range(3)]

ans = 'Yes'
for i in range(2):
  for j in range(2):
    if c[i][j] - c[i][j + 1] != c[i + 1][j] - c[i + 1][j + 1]:
      ans = 'No'
      break
print(ans)