import sys

input = sys.stdin.readline

mod = 10**9 + 7



n = int(eval(input()))

s = input().rstrip()



from collections import Counter



c = Counter(s)



n_ = len(list(c.keys()))



ans = 1



for i in list(c.keys()):

    ans *= (c[i] + 1)

    ans %= mod



ans -= 1



print(ans)
import sys

input = lambda : sys.stdin.readline().rstrip()

mod = 10**9 + 7



n = int(eval(input()))

s = eval(input())

from collections import Counter

c = Counter(s)

ans = 1

for i in c:

    ans *= c[i] + 1

    ans %= mod

ans -= 1

print(ans)        



import sys

input = sys.stdin.readline
mod = 10**9 + 7
n = int(eval(input()))
s = input().rstrip()
from collections import Counter

c = Counter(s)
n_ = len(list(c.keys()))
ans = 1
for i in list(c.keys()):
    ans *= c[i] + 1
    ans %= mod
ans -= 1
print(ans)

import sys

input = lambda: sys.stdin.readline().rstrip()
mod = 10**9 + 7
n = int(eval(input()))
s = eval(input())
from collections import Counter

c = Counter(s)
ans = 1
for i in c:
    ans *= c[i] + 1
    ans %= mod
ans -= 1
print(ans)

-input = sys.stdin.readline +input = lambda: sys.stdin.readline().rstrip() -s = input().rstrip() +s = eval(input()) -n_ = len(list(c.keys())) -for i in list(c.keys()): +for i in c: