program prob4
    character(len=100005)::S
    character::m(3)=(/'a','b','c'/)
    integer::cnt(4)
    integer::a,b,c,l,i,j
    read(*,*) S
    l = len_trim(S)
    cnt = 0

    do i = 1, l
        do j = 1, 3
            if(S(i:i) .eq. m(j)) then
                cnt(j) = cnt(j) + 1
            end if
        end do
    end do
    cnt(4) = cnt(1)

    do i = 1,3
        if(abs(cnt(i+1) - cnt(i)) > 1) then
            write(*,*) "NO"
            stop
        end if
    end do
    write(*,*) "YES"

    stop
end program