program prob4
    implicit none
    character(len=100005) :: S
    integer :: a,b,c
    integer :: i, N
    read(*,*) S
    N = len_trim(S)
    a = 0
    b = 0
    c = 0
    do i = 1, N
        if(S(i:i) == 'a') then
            a = a + 1
        else if(S(i:i) == 'b') then
            b = b + 1
        else
            c = c + 1
        end if
    end do

    if(abs(a-b) <= 1 .and. abs(b-c) <= 1 .and. abs(c-a) <= 1) then
        write(*,*) 'YES'
    else
        write(*,*) 'NO'
    end if


    stop
contains
end program prob4