program palindrome_phobia
  implicit none
  character(100000) :: s
  integer :: n, i, m(3)
  read(*,*) s
  s = trim(adjustl(s))
  n = len_trim(s)
  m = 0
  do i = 1, n
    m(ichar(s(i:i))-96) = m(ichar(s(i:i))-96)+1
  end do
  if (maxval(m)-minval(m).le.1) then
    write(*,'(a)') "YES"
  else
    write(*,'(a)') "NO"
  end if
  stop
end program palindrome_phobia