n=int(eval(input()))

s=list(eval(input()))

a=set(s)

ans=1

for i in a:

    ans=ans*(s.count(i)+1)%(10**9+7)

print((ans-1))
eval(input());s=eval(input());a=set(s)

ans=1

for i in a:ans=ans*(s.count(i)+1)%(10**9+7)

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

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

-n = int(eval(input())) -s = list(eval(input())) +eval(input()) +s = eval(input())