program sample
	implicit none
    integer(8) :: i,j,k,l,m,h,w
    integer(8) :: n,b,counta,countb,countc
    character(len=10**5) :: a
    
    read(*,*) a
    
    l=len_trim(a)
    counta=0
    countb=0
    countc=0
    
    do i=1,l
    	if (a(i:i)=='a') then
        	counta = counta +1
        else if (a(i:i)=='b') then
        	countb = countb +1
        else if (a(i:i)=='c') then
        	countc = countc +1
        end if
    end do
    !write(*,*) a(1:l),counta,countb,countc
    
    if (abs(counta-countb)>=2 .or. abs(counta-countc)>=2 .or. abs(countc-countb)>=2) then
    	write(*,*) 'NO'
    else 
    	write(*,*) 'YES'
    end if
    stop
end program sample