import Data.List

main = do
  s <- getLine
  let
    a = length $ filter (=='a') s
    b = length $ filter (=='b') s
    c = length $ filter (=='c') s
    

  putStrLn $ if maximum [a,b,c] - minimum [a,b,c] <= 1 then "YES" else "NO"

