n = int(eval(input()))

s = eval(input())

mod = 1000000007

alphacnt = [0]*26

ans = 0

for c in s:

    idx = ord(c)-ord("a")

    alphacnt[idx] += 1

    cnt = 1

    for i in range(26):

        if i == idx: continue

        cnt = (cnt*(alphacnt[i]+1))%mod

    ans = (ans+cnt)%mod

print(ans)
from collections import Counter

n = int(eval(input()))

s = eval(input())

mod = 1000000007

ans = 1

cnt = Counter(s)

for v in list(cnt.values()): ans = ans*(v+1)%mod

ans = (ans-1)%mod

print(ans)
n = int(eval(input()))
s = eval(input())
mod = 1000000007
alphacnt = [0] * 26
ans = 0
for c in s:
    idx = ord(c) - ord("a")
    alphacnt[idx] += 1
    cnt = 1
    for i in range(26):
        if i == idx:
            continue
        cnt = (cnt * (alphacnt[i] + 1)) % mod
    ans = (ans + cnt) % mod
print(ans)

from collections import Counter

n = int(eval(input()))
s = eval(input())
mod = 1000000007
ans = 1
cnt = Counter(s)
for v in list(cnt.values()):
    ans = ans * (v + 1) % mod
ans = (ans - 1) % mod
print(ans)

+from collections import Counter + -alphacnt = [0] * 26 -ans = 0 -for c in s: -    idx = ord(c) - ord("a") -    alphacnt[idx] += 1 -    cnt = 1 -    for i in range(26): -        if i == idx: -            continue -        cnt = (cnt * (alphacnt[i] + 1)) % mod -    ans = (ans + cnt) % mod +ans = 1 +cnt = Counter(s) +for v in list(cnt.values()): +    ans = ans * (v + 1) % mod +ans = (ans - 1) % mod