output_description: If the objective is achievable, print `YES`; if it is unachievable, print
  `NO`.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      S
attempt: s = input()
  
  dic = {}
  for i in range(len(s)):
      if s[i] in dic:
          dic[s[i]] += 1
      else:
          dic[s[i]] = 1
  
  if len(dic) == 1:
      if len(s) == 1:
          print("YES")
      else:
          print("NO")
  
  elif len(dic) == 2:
      print("NO")
  
  else:
      first = "a"
      second = "b"
      for k, v in dic.items():
          if v > dic[first]:
              if k != first:
                  second = first
                  first = k
  
          elif v > dic[second]:
              if k != second and k != first:
                  second = k
  
      tmp = first + second
      dic[first] -= 1
      dic[second] -= 1
      ans = "YES"
  
      for i in range(1, len(s) - 1):
          if tmp[i - 1] == "a":
              if tmp[i] == "b":
                  if dic["c"] == 0:
                      ans = "NO"
                      break
                  else:
                      dic["c"] -= 1
                      tmp += "c"
  
              if tmp[i] == "c":
                  if dic["b"] == 0:
                      ans = "NO"
                      break
                  else:
                      dic["b"] -= 1
                      tmp += "b"
  
          elif tmp[i - 1] == "b":
              if tmp[i] == "a":
                  if dic["c"] == 0:
                      ans = "NO"
                      break
                  else:
                      dic["c"] -= 1
                      tmp += "c"
  
              if tmp[i] == "c":
                  if dic["a"] == 0:
                      ans = "NO"
                      break
                  else:
                      dic["a"] -= 1
                      tmp += "a"
  
          elif tmp[i - 1] == "c":
              if tmp[i] == "a":
                  if dic["b"] == 0:
                      ans = "NO"
                      break
                  else:
                      dic["b"] -= 1
                      tmp += "b"
  
              if tmp[i] == "b":
                  if dic["a"] == 0:
                      ans = "NO"
                      break
                  else:
                      dic["a"] -= 1
                      tmp += "a"
  
      print(ans)
  
problem_description: Statement
  
  Snuke has a string S consisting of three kinds of letters: `a`, `b` and `c`.
  
  He has a phobia for palindromes, and wants to permute the characters in S so
  that S will not contain a palindrome of length 2 or more as a substring.
  Determine whether this is possible.
samples: [{"input": "abac", "output": "YES\n    \n\nAs it stands now, S contains a palindrome `aba`, but we can permute the\ncharacters to get `acba`, for example, that does not contain a palindrome of\nlength 2 or more.\n\n* * *"}, {"input": "aba", "output": "NO\n    \n\n* * *"}, {"input": "babacccabab", "output": "YES"}]