import Data.Sort

countCharactersInString :: String -> Char -> Int
countCharactersInString s c = length $ filter (== c) s

f :: Int -> Int -> Int -> String
f na nb nc 
  | z > 2*y || z > 2*x || y > 2*x = "NO"
  | otherwise = "YES"
    where
      [x, y, z] = sort [na, nb, nc]

main = do
  s <- getLine
  let na = countCharactersInString s 'a'
  let nb = countCharactersInString s 'b'
  let nc = countCharactersInString s 'c'
  putStrLn $ f na nb nc
