from collections import *

_=eval(input())

c=Counter(eval(input()))

ans=1

for i in list(c.values()):

    ans*=i+1

    ans%=10**9+7

print((ans-1))
_=eval(input())

s=eval(input())

ans=1

for i in set(s):

    ans*=s.count(i)+1

    ans%=10**9+7

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

_ = eval(input())
c = Counter(eval(input()))
ans = 1
for i in list(c.values()):
    ans *= i + 1
    ans %= 10**9 + 7
print((ans - 1))

_ = eval(input())
s = eval(input())
ans = 1
for i in set(s):
    ans *= s.count(i) + 1
    ans %= 10**9 + 7
print((ans - 1))

-from collections import * - -c = Counter(eval(input())) +s = eval(input()) -for i in list(c.values()): -    ans *= i + 1 +for i in set(s): +    ans *= s.count(i) + 1