#AGC031 A Colorful Subsequence

# Answer

N = int(eval(input()))

S = eval(input())

alpha = [0]*26

mod = 10**9+7



for n in S:

    num = ord(n)-97

    alpha[num] += 1

    

ans = 1

for i in range(26):

    ans *= (alpha[i]+1)



# ans %= mod

print(((ans-1)%mod))
N = int(eval(input()))

S = eval(input())

alpha = [0]*123

mod = 10**9+7



for n in S:

    num = ord(n)

    alpha[num] += 1

    

ans = 1

for i in range(97,123):

    ans *= (alpha[i]+1)%mod



ans -= 1

ans %= mod

print(ans)



# AGC031 A Colorful Subsequence
# Answer
N = int(eval(input()))
S = eval(input())
alpha = [0] * 26
mod = 10**9 + 7
for n in S:
    num = ord(n) - 97
    alpha[num] += 1
ans = 1
for i in range(26):
    ans *= alpha[i] + 1
# ans %= mod
print(((ans - 1) % mod))

N = int(eval(input()))
S = eval(input())
alpha = [0] * 123
mod = 10**9 + 7
for n in S:
    num = ord(n)
    alpha[num] += 1
ans = 1
for i in range(97, 123):
    ans *= (alpha[i] + 1) % mod
ans -= 1
ans %= mod
print(ans)

-# AGC031 A Colorful Subsequence -# Answer -alpha = [0] * 26 +alpha = [0] * 123 -    num = ord(n) - 97 +    num = ord(n) -for i in range(26): -    ans *= alpha[i] + 1 -# ans %= mod -print(((ans - 1) % mod)) +for i in range(97, 123): +    ans *= (alpha[i] + 1) % mod +ans -= 1 +ans %= mod +print(ans)