{-# LANGUAGE BangPatterns #-}
import           Control.Exception           (assert)
import           Control.Monad
import           Control.Monad.Primitive
import qualified Control.Monad.ST            as ST
import qualified Data.Array.IO               as IO
import qualified Data.Array.ST               as ST
import qualified Data.Array.Unboxed          as A
import           Data.Bits
import qualified Data.ByteString.Char8       as BS
import           Data.Char
import           Data.Foldable
import           Data.List
import           Data.Maybe
import qualified Data.Sequence               as Seq
import qualified Data.Set                    as Set
import qualified Data.Vector.Unboxed         as V
import qualified Data.Vector.Unboxed.Mutable as VM
import           Debug.Trace

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine
getIntVec n = V.unfoldrN n (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine

readInteger = fst . fromJust . BS.readInteger
readIntegerList = map readInteger . BS.words
getInteger = readInteger <$> BS.getLine
getIntegerList = readIntegerList <$> BS.getLine

main = do
  s <- getLine

  let countABC [] a b c = (a, b, c)
      countABC (x:xs) a b c | x == 'a' = countABC xs (a+1) b c
                            | x == 'b' = countABC xs a (b+1) c
                            | x == 'c' = countABC xs a b (c+1)

      (na, nb, nc) = countABC s 0 0 0

      mn = min na (min nb nc)

      (na', nb', nc') = (na - mn, nb -mn, nc - mn)

      ans = if na' <= 1 && na' >= nb' && nb' >= nc'
            then "YES"
            else "NO"

  putStrLn ans