let s = read_line ()
let f x = let n = ref 0 in String.iter (fun c -> if c = x then incr n) s; !n
let a, b, c = f 'a', f 'b', f 'c'
let m = max a @@ max b c
let _ = print_endline @@ if max (m - a) @@ max (m - b) (m - c) > 1 then "NO" else "YES"