output_description: If Snuke can make the grid symmetric, print `YES`; if he cannot, print `NO`.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      H W
      S_1
      S_2
      :
      S_H
attempt: n, m = map(int, input().split())
  lis = [0 for i in range(26)]
  for _ in range(n):
      s = list(str(input()))
      for i in range(m):
          lis[ord(str(s[i])) - ord("a")] += 1
  if n % 2 == 0 or m % 2 == 0:
      for i in range(26):
          if lis[i] % 2 == 1:
              print("NO")
              exit()
      print("YES")
  else:
      cou = 0
      for i in range(26):
          if lis[i] % 2 == 1:
              cou += 1
          if cou > 1:
              print("NO")
              exit()
      print("YES")
  
problem_description: Statement
  
  There is an H \times W grid (H vertical, W horizontal), where each square
  contains a lowercase English letter. Specifically, the letter in the square at
  the i-th row and j-th column is equal to the j-th character in the string S_i.
  
  Snuke can apply the following operation to this grid any number of times:
  
    * Choose two different rows and swap them. Or, choose two different columns and swap them.
  
  Snuke wants this grid to be _symmetric_. That is, for any 1 \leq i \leq H and
  1 \leq j \leq W, the letter in the square at the i-th row and j-th column and
  the letter in the square at the (H + 1 - i)-th row and (W + 1 - j)-th column
  should be equal.
  
  Determine if Snuke can achieve this objective.
samples: [{"input": "2 3\n    arc\n    rac", "output": "YES\n    \n\nIf the second and third columns from the left are swapped, the grid becomes\nsymmetric, as shown in the image below:\n\n![](https://img.atcoder.jp/arc095/2b61caf45e7c5c7311e3944f3418b0bb.png)\n\n* * *"}, {"input": "3 7\n    atcoder\n    regular\n    contest", "output": "NO\n    \n\n* * *"}, {"input": "12 12\n    bimonigaloaf\n    faurwlkbleht\n    dexwimqxzxbb\n    lxdgyoifcxid\n    ydxiliocfdgx\n    nfoabgilamoi\n    ibxbdqmzxxwe\n    pqirylfrcrnf\n    wtehfkllbura\n    yfrnpflcrirq\n    wvcclwgiubrk\n    lkbrwgwuiccv", "output": "YES"}]