main = do
    s <- getLine
    let n = length s
        a = length $ filter (== 'a') s
        b = length $ filter (== 'b') s
        c = (n - a - b)
    putStrLn $ if all (>= n `div` 3) [a,b,c] then "YES" else "NO"