S = input()
if len(S)<=2:
  print("YES")
else:
  ca = S.count("a")
  cb = S.count("b")
  cc = S.count("c")
  n = len(S)//3
  ca2 = ca - n
  cb2 = cb - n
  cc2 = cc - n
  flg = [ca2,cb2,cc2]
  if flg.count(0)==3:
    print("YES")
  elif flg.count(1)==1 and flg.count(0)==2:
    print("YES")
  elif flg.count(1)==2 and flg.count(0)==1:
    print("YES")
  elif flg.count(2)==1 and flg.count(1)==2:
    print("YES")
  else:
    print("NO")