from collections import defaultdict





def readln():

    return list(map(int, input().split()))





N = readln()[0]

S = eval(input())

mod = 10**9+7



dic = defaultdict(lambda: 0)

for s in S:

    dic[s] += 1

ans = 1

for count in list(dic.values()):

    # print(count)

    ans *= (count + 1)

    ans %= mod



# print(ans)

print((ans-1))

from collections import defaultdict, Counter





def readln():

    return list(map(int, input().split()))





N = readln()[0]

S = eval(input())

mod = 10**9+7



dic = Counter(S)



ans = 1

for count in list(dic.values()):

    # print(count)

    ans *= (count + 1)

    ans %= mod



# print(ans)

print((ans-1))

from collections import defaultdict


def readln():
    return list(map(int, input().split()))


N = readln()[0]
S = eval(input())
mod = 10**9 + 7
dic = defaultdict(lambda: 0)
for s in S:
    dic[s] += 1
ans = 1
for count in list(dic.values()):
    # print(count)
    ans *= count + 1
    ans %= mod
# print(ans)
print((ans - 1))

from collections import defaultdict, Counter


def readln():
    return list(map(int, input().split()))


N = readln()[0]
S = eval(input())
mod = 10**9 + 7
dic = Counter(S)
ans = 1
for count in list(dic.values()):
    # print(count)
    ans *= count + 1
    ans %= mod
# print(ans)
print((ans - 1))

-from collections import defaultdict +from collections import defaultdict, Counter -dic = defaultdict(lambda: 0) -for s in S: -    dic[s] += 1 +dic = Counter(S)