output_description: If Snuke can create a matrix satisfying the condition, print `Yes`; otherwise,
  print `No`.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      H W
      a_{11}a_{12}...a_{1W}
      :
      a_{H1}a_{H2}...a_{HW}
attempt: n, m = [int(c) for c in input().split(" ")]
  mx = [input() for _ in range(n)]
  
  table = [[0] * m for _ in range(n)]
  counter = 0
  for i in range(n):
      for j in range(m):
          if table[i][j]:
              continue
          counter += 1
          # print("Set {} for ({},{}), ({},{}), ({},{}), ({},{}).".format(
          #     counter, i, j, n-i-1, j, i, m-j-1, n-i-1, m-j-1
          # ))
          table[i][j] = table[n - i - 1][j] = table[i][m - j - 1] = table[n - i - 1][
              m - j - 1
          ] = counter
  # print(table)
  
  cnt_need = [0] * counter
  cnt_had = [0] * 26
  for i in range(n):
      for j in range(m):
          cnt_need[table[i][j] - 1] += 1
          cnt_had[ord(mx[i][j]) - ord("a")] += 1
  
  cnt_need.sort()
  cnt1, cnt2, cnt4 = [0] * 3
  for cnt in cnt_need:
      if cnt == 1:
          cnt1 += 1
      elif cnt == 2:
          cnt2 += 1
      elif cnt == 4:
          cnt4 += 1
      else:
          raise RuntimeError("Unexpected count: {}".format(cnt))
  assert cnt1 in [0, 1], "Unexpected count of units: {}".format(cnt1)
  
  possible = 1
  for had in cnt_had:
      if had % 2:
          if cnt1 > 0:
              cnt1 -= 1
              had -= 1
          else:
              possible = 0
      if had % 4:
          if cnt2 > 0:
              cnt2 -= 1
              had -= 2
          else:
              possible = 0
  
  print("Yes" if possible else "No")
  
problem_description: Statement
  
  We have an H-by-W matrix. Let a_{ij} be the element at the i-th row from the
  top and j-th column from the left. In this matrix, each a_{ij} is a lowercase
  English letter.
  
  Snuke is creating another H-by-W matrix, A', by freely rearranging the
  elements in A. Here, he wants to satisfy the following condition:
  
    * Every row and column in A' can be read as a palindrome.
  
  Determine whether he can create a matrix satisfying the condition.
samples: [{"input": "3 4\n    aabb\n    aabb\n    aacc", "output": "Yes\n    \n\nFor example, the following matrix satisfies the condition.\n\n    \n    \n    abba\n    acca\n    abba\n    \n\n* * *"}, {"input": "2 2\n    aa\n    bb", "output": "No\n    \n\nIt is not possible to create a matrix satisfying the condition, no matter how\nwe rearrange the elements in A.\n\n* * *"}, {"input": "5 1\n    t\n    w\n    e\n    e\n    t", "output": "Yes\n    \n\nFor example, the following matrix satisfies the condition.\n\n    \n    \n    t\n    e\n    w\n    e\n    t\n    \n\n* * *"}, {"input": "2 5\n    abxba\n    abyba", "output": "No\n    \n\n* * *"}, {"input": "1 1\n    z", "output": "Yes"}]