program phobia
  implicit none
  character(len=100000) :: s
  integer :: ca, cb, cc
  integer :: i

  ca = 0
  cb = 0
  cc = 0
 
  read(*,*) s

  do i = 1, len_trim(s)
     if (s(i:i) == 'a') then
        ca = ca + 1
     else if (s(i:i) == 'b') then
        cb = cb + 1
     else if (s(i:i) == 'c') then
        cc = cc + 1
     end if
  end do

  if ( max(abs(ca-cb) ,abs(cb-cc) ,abs(cc-ca) ) <= 1 ) then
     write(*,'(a)') 'YES'
  else
     write(*,'(a)') 'NO'
  end if
  stop
end program phobia
