program Colorful_Subsequence
    implicit none
    integer(8):: cnt(ichar('z') - ichar('a') + 1), ans
    character(:), allocatable:: s
    integer(4):: n, i
    integer(8),parameter:: md = 1000000007

    read*, n
    allocate(character(n):: s)
    read*, s

    cnt(:) = 1_8
    block
        integer(4):: index
        do i=1, n
            index = ichar(s(i:i)) - ichar('a')+1
            cnt(index)=cnt(index)+1_8
        end do
    end block

    ans=1
    
    do i=1,ichar('z') - ichar('a') + 1
        ans = mod(ans*cnt(i), md)
    end do

    print*, ans - 1
end program Colorful_Subsequence