eval(input());s=eval(input())

a,*b=[s.count(i)+1for i in set(s)]

for t in b:a=t*a%(10**9+7)

print((a-1))


eval(input());s=eval(input())

a,*b=list(map(s.count,set(s)));a+=1

for t in b:a=-~t*a%(10**9+7)

print((a-1))
eval(input())
s = eval(input())
a, *b = [s.count(i) + 1 for i in set(s)]
for t in b:
    a = t * a % (10**9 + 7)
print((a - 1))

eval(input())
s = eval(input())
a, *b = list(map(s.count, set(s)))
a += 1
for t in b:
    a = -~t * a % (10**9 + 7)
print((a - 1))

-a, *b = [s.count(i) + 1 for i in set(s)] +a, *b = list(map(s.count, set(s))) +a += 1 -    a = t * a % (10**9 + 7) +    a = -~t * a % (10**9 + 7)