let () =
  let dp = Array.make 3 0 in
  String.iter (function
    | 'a' -> dp.(0) <- 1 + dp.(0)
    | 'b' -> dp.(1) <- 1 + dp.(1)
    | 'c' -> dp.(2) <- 1 + dp.(2)) (read_line ());
  print_endline @@
  if Array.fold_left max min_int dp - Array.fold_left min max_int dp <= 1
  then "YES"
  else "NO"
