n = int(eval(input()))

s = eval(input())

MOD = 10**9+7



from collections import defaultdict

import string

d = defaultdict(int)

let = string.ascii_lowercase



for ele in s:

  d[ele] += 1



ans = 1

for i in range(26):

  if d[let[i]]>0:

    ans = (ans * (d[let[i]]+1))%MOD

print((ans-1))
n = int(eval(input()))

s = eval(input())

from collections import Counter

c = Counter(s)

ans = 0

mod = 10**9+7

for k, v in list(c.items()):

  if ans == 0:

    ans = v+1

  else:

    ans = (ans * (v+1)) % mod

print((ans-1))
n = int(eval(input()))
s = eval(input())
MOD = 10**9 + 7
from collections import defaultdict
import string

d = defaultdict(int)
let = string.ascii_lowercase
for ele in s:
    d[ele] += 1
ans = 1
for i in range(26):
    if d[let[i]] > 0:
        ans = (ans * (d[let[i]] + 1)) % MOD
print((ans - 1))

n = int(eval(input()))
s = eval(input())
from collections import Counter

c = Counter(s)
ans = 0
mod = 10**9 + 7
for k, v in list(c.items()):
    if ans == 0:
        ans = v + 1
    else:
        ans = (ans * (v + 1)) % mod
print((ans - 1))

-MOD = 10**9 + 7 -from collections import defaultdict -import string +from collections import Counter -d = defaultdict(int) -let = string.ascii_lowercase -for ele in s: -    d[ele] += 1 -ans = 1 -for i in range(26): -    if d[let[i]] > 0: -        ans = (ans * (d[let[i]] + 1)) % MOD +c = Counter(s) +ans = 0 +mod = 10**9 + 7 +for k, v in list(c.items()): +    if ans == 0: +        ans = v + 1 +    else: +        ans = (ans * (v + 1)) % mod