from collections import defaultdict

n=int(eval(input()))

s=eval(input())

mod=pow(10,9)+7

sd=defaultdict(lambda:1)

for i in range(n):

      sd[s[i]]+=1

ans=1

for k in list(sd.keys()):

      ans*=(sd[k])%mod

print((ans%mod-1))

from collections import Counter

mod=pow(10,9)+7

n=int(eval(input()))

s=eval(input())

cs=Counter(s)

ans=1

for a in list(cs.values()):

  ans*=a+1

  ans%=mod

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

n = int(eval(input()))
s = eval(input())
mod = pow(10, 9) + 7
sd = defaultdict(lambda: 1)
for i in range(n):
    sd[s[i]] += 1
ans = 1
for k in list(sd.keys()):
    ans *= (sd[k]) % mod
print((ans % mod - 1))

from collections import Counter

mod = pow(10, 9) + 7
n = int(eval(input()))
s = eval(input())
cs = Counter(s)
ans = 1
for a in list(cs.values()):
    ans *= a + 1
    ans %= mod
print((ans - 1))

-from collections import defaultdict +from collections import Counter +mod = pow(10, 9) + 7 -mod = pow(10, 9) + 7 -sd = defaultdict(lambda: 1) -for i in range(n): -    sd[s[i]] += 1 +cs = Counter(s) -for k in list(sd.keys()): -    ans *= (sd[k]) % mod -print((ans % mod - 1)) +for a in list(cs.values()): +    ans *= a + 1 +    ans %= mod +print((ans - 1))