output_description: If Takahashi's statement is correct, print `Yes`; otherwise, print `No`.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      c_{1,1} c_{1,2} c_{1,3}
      c_{2,1} c_{2,2} c_{2,3}
      c_{3,1} c_{3,2} c_{3,3}
attempt: import sys
  import math
  import collections
  import itertools
  import array
  import inspect
  
  # Set max recursion limit
  sys.setrecursionlimit(10000)
  
  
  # Debug output
  def chkprint(*args):
      names = {id(v): k for k, v in inspect.currentframe().f_back.f_locals.items()}
      print(", ".join(names.get(id(arg), "???") + " = " + repr(arg) for arg in args))
  
  
  # Binary converter
  def to_bin(x):
      return bin(x)[2:]
  
  
  # Set 2 dimension list
  def dim2input(N):
      li = []
      for _ in range(N):
          li.append(list(map(int, input())))
      return li
  
  
  """ input template
  S = input()
  N = int(input())
  L = list(map(int, input().split()))
  a, b = list(map(int, input().split()))
  SL = list(input())
  """
  
  # --------------------------------------------
  
  dp = None
  
  
  def main():
      C = []
  
      for _ in range(3):
          C.append(list(map(int, input().split())))
  
      a1_limit = min(C[0]) + 1
      a2_limit = min(C[1]) + 1
      a3_limit = min(C[2]) + 1
      b1_limit = min(C[0][0], C[1][0], C[2][0]) + 1
      b2_limit = min(C[0][1], C[1][1], C[2][1]) + 1
      b3_limit = min(C[0][2], C[1][2], C[2][2]) + 1
  
      A1, A2, A3, B1, B2, B3 = [], [], [], [], [], []
      for i in range(a1_limit):
          A1.append(i)
      for i in range(a2_limit):
          A2.append(i)
      for i in range(a3_limit):
          A3.append(i)
      for i in range(b1_limit):
          B1.append(i)
      for i in range(b2_limit):
          B2.append(i)
      for i in range(b3_limit):
          B3.append(i)
  
      for a1, a2, a3 in itertools.product(A1, A2, A3):
          b1 = C[0][0] - a1
          b2 = C[1][1] - a2
          b3 = C[2][2] - a3
  
          if a1 + b1 != C[0][0]:
              continue
          if a2 + b1 != C[1][0]:
              continue
          if a3 + b1 != C[2][0]:
              continue
          if a1 + b2 != C[0][1]:
              continue
          if a2 + b2 != C[1][1]:
              continue
          if a3 + b2 != C[2][1]:
              continue
          if a1 + b3 != C[0][2]:
              continue
          if a2 + b3 != C[1][2]:
              continue
          if a3 + b3 != C[2][2]:
              continue
  
          print("Yes")
          return
  
      print("No")
  
  
  main()
  
problem_description: Statement
  
  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.
samples: [{"input": "1 0 1\n    2 1 2\n    1 0 1", "output": "Yes\n    \n\nTakahashi is correct, since there are possible sets of integers such as:\na_1=0,a_2=1,a_3=0,b_1=1,b_2=0,b_3=1.\n\n* * *"}, {"input": "2 2 2\n    2 1 2\n    2 2 2", "output": "No\n    \n\nTakahashi is incorrect in this case.\n\n* * *"}, {"input": "0 8 8\n    0 8 8\n    0 8 8", "output": "Yes\n    \n\n* * *"}, {"input": "1 8 6\n    2 9 7\n    0 7 7", "output": "No"}]