N = int(eval(input()))

S = eval(input())



M = 10**9 + 7

cnt = [0] * 26



for i in range(N):

    cnt[ord(S[i]) - ord('a')] += 1



ans = 1

for i in range(26):

    ans *= (cnt[i] + 1)

    ans %= M



print((ans - 1))
from collections import defaultdict





N = int(eval(input()))

S = eval(input())



M = 10**9 + 7

count_dict = defaultdict(int)



for s in S:

    count_dict[s] += 1



ans = 1

for v in list(count_dict.values()):

    ans *= (v + 1)

    ans %= M



print((ans - 1))

N = int(eval(input()))
S = eval(input())
M = 10**9 + 7
cnt = [0] * 26
for i in range(N):
    cnt[ord(S[i]) - ord("a")] += 1
ans = 1
for i in range(26):
    ans *= cnt[i] + 1
    ans %= M
print((ans - 1))

from collections import defaultdict

N = int(eval(input()))
S = eval(input())
M = 10**9 + 7
count_dict = defaultdict(int)
for s in S:
    count_dict[s] += 1
ans = 1
for v in list(count_dict.values()):
    ans *= v + 1
    ans %= M
print((ans - 1))

+from collections import defaultdict + -cnt = [0] * 26 -for i in range(N): -    cnt[ord(S[i]) - ord("a")] += 1 +count_dict = defaultdict(int) +for s in S: +    count_dict[s] += 1 -for i in range(26): -    ans *= cnt[i] + 1 +for v in list(count_dict.values()): +    ans *= v + 1