program sample
    implicit none
    character(len=100000)::s
    integer(8) :: i,j,m,n,a,b,c,x(3)
    integer(8),allocatable :: y(:)
  
    read(*,*) s
    x(:)=0
    n=len_trim(s)
    do i=1,n
        if (s(i:i) .eq. 'a')then
            x(1)=x(1)+1
        else if (s(i:i) .eq. 'b')then
            x(2)=x(2)+1
        else
            x(3)=x(3)+1
        end if
    end do
    
    if (abs(x(1)-x(2))<2 .and. abs(x(2)-x(3))<2 .and. abs(x(1)-x(3))<2 )then
     write(*,*) 'Yes'
    else
        write(*,*)'No'
    end if
  
    stop
end program sample
  

