let S = stdin.ReadLine().ToCharArray()

let folder x c =
    let i = 
        match c with
        | 'a' -> 0
        | 'b' -> 1
        | _ -> 2
    Array.set x i (x.[i]+1)
    x

let counter = S |> Array.fold folder [|0; 0; 0|]

if counter |> Array.exists ((=) 0) then
    "NO"
else
    let mini = Array.min counter
    if counter 
       |> Array.map (fun x -> x - mini)
       |> Array.exists ((<) 1)
    then "NO"
    else "YES"
|> stdout.WriteLine