output_description: Print `Yes` if it is possible to meet the conditions by properly writing
  integers into all remaining cells. Otherwise, print `No`.
  
  * * *
input_description: The input is given from Standard Input in the following format:
  
      
      
      R C
      N
      r_1 c_1 a_1
      r_2 c_2 a_2
      :
      r_N c_N a_N
attempt: from collections import defaultdict, deque
  import sys, heapq, bisect, math, itertools, string, queue, datetime
  
  sys.setrecursionlimit(10**8)
  INF = float("inf")
  mod = 10**9 + 7
  eps = 10**-7
  
  
  def inpl():
      return list(map(int, input().split()))
  
  
  def inpl_s():
      return list(input().split())
  
  
  def find(x):  # xの根を返す
      global table
      global diff_weight
  
      if table[x] == x:
          return x
      else:
          root = find(table[x])
          diff_weight[x] += diff_weight[table[x]]  # 親の更新に伴う 重みの更新
          table[x] = root  # 親の更新(根を直接親にして参照距離を短く)
          return table[x]
  
  
  def union(x, y, w):  # xとyを diff(x,y)=w で繋げる
      w = w - weight(y) + weight(x)
      x = find(x)
      y = find(y)
  
      if x == y:
          return
  
      if rank[x] < rank[y]:
          x, y = y, x
          w = -w
  
      table[y] = x
      diff_weight[y] = w
  
      if rank[x] == rank[y]:
          rank[y] += 1
  
  
  def check(x, y):  # xとyか繋がっているか -> return bool
      if find(x) == find(y):
          return True
      else:
          return False
  
  
  def weight(x):
      find(x)  # 経路圧縮
      return diff_weight[x]
  
  
  def diff(x, y):  # weight(y)-weight(x)  (繋がってる前提)
      return weight(y) - weight(x)
  
  
  H, W = inpl()
  N = int(input())
  lines = defaultdict(set)
  
  table = [i for i in range(W)]  # 木の親 table[x] == x なら根
  rank = [1 for i in range(W)]  # 木の長さ
  diff_weight = [0 for i in range(W)]
  
  
  for _ in range(N):
      y, x, a = inpl()
      x, y = x - 1, y - 1
      lines[y].add((x, a))
  
  for y in range(H):
      for i, [x, c] in enumerate(lines[y]):
          if i == 0:
              bx, bc = x, c
              continue
          else:
              if check(x, bx):
                  if diff(x, bx) != c - bc:
                      print("No")
                      sys.exit()
              else:
                  if c > bc:
                      union(x, bx, c - bc)
                  else:
                      union(bx, x, bc - c)
          bx, bc = x, c
  
  
  MAX = max(diff_weight)
  
  for y in range(H):
      for x, c in lines[y]:
          if c - (MAX - diff_weight[x]) < 0:
              print("No")
              sys.exit()
  
  print("Yes")
  
problem_description: Statement
  
  There is a grid with R rows and C columns. We call the cell in the r-th row
  and c-th column (r，c).
  
  Mr. Takahashi wrote non-negative integers into N of the cells, that is, he
  wrote a non-negative integer a_i into (r_i，c_i) for each i (1≤i≤N). After that
  he fell asleep.
  
  Mr. Aoki found the grid and tries to surprise Mr. Takahashi by writing
  integers into all remaining cells. The grid must meet the following conditions
  to really surprise Mr. Takahashi.
  
    * Condition 1: Each cell contains a non-negative integer.
    * Condition 2: For any 2×2 square formed by cells on the grid, the sum of the top left and bottom right integers must always equal to the sum of the top right and bottom left integers.
  
  Determine whether it is possible to meet those conditions by properly writing
  integers into all remaining cells.
samples: [{"input": "2 2\n    3\n    1 1 0\n    1 2 10\n    2 1 20", "output": "Yes\n    \n\nYou can write integers as follows.\n\n![](/img/other/code_festival_2016_quala/gbanjthabot/D_0.png)\n\n* * *"}, {"input": "2 3\n    5\n    1 1 0\n    1 2 10\n    1 3 20\n    2 1 30\n    2 3 40", "output": "No\n    \n\nThere are two 2\u00d72 squares on the grid, formed by the following cells:\n\n  * Cells (1\uff0c1), (1\uff0c2), (2\uff0c1) and (2\uff0c2)\n  * Cells (1\uff0c2), (1\uff0c3), (2\uff0c2) and (2\uff0c3)\n\nYou have to write 40 into the empty cell to meet the condition on the left\nsquare, but then it does not satisfy the condition on the right square.\n\n![](/img/other/code_festival_2016_quala/gbanjthabot/D_1.png)\n\n* * *"}, {"input": "2 2\n    3\n    1 1 20\n    1 2 10\n    2 1 0", "output": "No\n    \n\nYou have to write -10 into the empty cell to meet condition 2, but then it\ndoes not satisfy condition 1.\n\n![](/img/other/code_festival_2016_quala/gbanjthabot/D_2.png)\n\n* * *"}, {"input": "3 3\n    4\n    1 1 0\n    1 3 10\n    3 1 10\n    3 3 20", "output": "Yes\n    \n\nYou can write integers as follows.\n\n![](/img/other/code_festival_2016_quala/gbanjthabot/D_3.png)\n\n* * *"}, {"input": "2 2\n    4\n    1 1 0\n    1 2 10\n    2 1 30\n    2 2 20", "output": "No\n    \n\nAll cells already contain a integer and condition 2 is not satisfied.\n\n![](/img/other/code_festival_2016_quala/gbanjthabot/D_4.png)"}]