s = gets.chomp
h = Hash.new 0
s.chars{|c| h[c]+=1}
l = s.size/2
#p h[?a],h[?b], h[?c]
if s.size==1 then
  puts 'YES'
else
  if s.size<5 then
    if (h['a']>l || h['b']>l || h['c']>l) then
      puts 'NO'
    else
      puts 'YES'
    end
  elsif h['a']>=l || h['b']>=l || h['c']>=l then
    puts 'NO'
  else
    puts 'YES'
  end
end