from collections import *

from functools import *



n = int(eval(input()))

s = eval(input())



counter_s = [i[1] + 1 for i in Counter(s).most_common()]

ans = reduce(lambda x, y: (x * y) % (10 ** 9 + 7), counter_s)



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

from functools import *



n = int(eval(input()))

s = eval(input())



counter_s = [x + 1 for x in list(Counter(s).values())]

ans = reduce(lambda x, y: (x * y) % (10 ** 9 + 7), counter_s)



print((ans - 1))
from collections import *
from functools import *

n = int(eval(input()))
s = eval(input())
counter_s = [i[1] + 1 for i in Counter(s).most_common()]
ans = reduce(lambda x, y: (x * y) % (10**9 + 7), counter_s)
print((ans - 1))

from collections import *
from functools import *

n = int(eval(input()))
s = eval(input())
counter_s = [x + 1 for x in list(Counter(s).values())]
ans = reduce(lambda x, y: (x * y) % (10**9 + 7), counter_s)
print((ans - 1))

-counter_s = [i[1] + 1 for i in Counter(s).most_common()] +counter_s = [x + 1 for x in list(Counter(s).values())]