from sys import stdin

import string

from itertools import groupby



n = int(stdin.readline().rstrip())

s = list(stdin.readline().rstrip())

s.sort()

lin = []

for key, value in groupby(s):

    lin.append(len(list(value)))

point = 1

for i in lin:

    point *= i+1

    point %= 10**9+7

print((point-1))
from collections import Counter



n = int(eval(input()))

s = eval(input())

mod = 10**9+7



c = Counter(s)



point = 1



for i,j in list(c.items()):

    point *= j+1

    point %= mod



point -= 1

print(point)
from sys import stdin
import string
from itertools import groupby

n = int(stdin.readline().rstrip())
s = list(stdin.readline().rstrip())
s.sort()
lin = []
for key, value in groupby(s):
    lin.append(len(list(value)))
point = 1
for i in lin:
    point *= i + 1
    point %= 10**9 + 7
print((point - 1))

from collections import Counter

n = int(eval(input()))
s = eval(input())
mod = 10**9 + 7
c = Counter(s)
point = 1
for i, j in list(c.items()):
    point *= j + 1
    point %= mod
point -= 1
print(point)

-from sys import stdin -import string -from itertools import groupby +from collections import Counter -n = int(stdin.readline().rstrip()) -s = list(stdin.readline().rstrip()) -s.sort() -lin = [] -for key, value in groupby(s): -    lin.append(len(list(value))) +n = int(eval(input())) +s = eval(input()) +mod = 10**9 + 7 +c = Counter(s) -for i in lin: -    point *= i + 1 -    point %= 10**9 + 7 -print((point - 1)) +for i, j in list(c.items()): +    point *= j + 1 +    point %= mod +point -= 1 +print(point)