from collections import Counter



import scipy.misc as scm



n = int(eval(input()))

s = list(eval(input()))

tmp = len(set(s))

count_s = Counter(s)

count_s = count_s.most_common()

ans = 1

for i in range(tmp):

  if count_s[i][1] > 1:

    ans *= (count_s[i][1]+1)

    ans = ans % (10**9+7)

  else:

    ans *= 2

    ans = ans % (10**9+7)

ans -= 1

print(ans)

from collections import Counter



if __name__ == '__main__':

    n = int(eval(input()))

    s = list(eval(input()))

    s = Counter(s)

    s = s.most_common()

    ans = 1



    for k, v in s:

        if v > 1:

            ans *= v + 1

        else:

            ans *= 2

        ans %= (10 ** 9 + 7)



    print((ans - 1))

from collections import Counter
import scipy.misc as scm

n = int(eval(input()))
s = list(eval(input()))
tmp = len(set(s))
count_s = Counter(s)
count_s = count_s.most_common()
ans = 1
for i in range(tmp):
    if count_s[i][1] > 1:
        ans *= count_s[i][1] + 1
        ans = ans % (10**9 + 7)
    else:
        ans *= 2
        ans = ans % (10**9 + 7)
ans -= 1
print(ans)

from collections import Counter

if __name__ == "__main__":
    n = int(eval(input()))
    s = list(eval(input()))
    s = Counter(s)
    s = s.most_common()
    ans = 1
    for k, v in s:
        if v > 1:
            ans *= v + 1
        else:
            ans *= 2
        ans %= 10**9 + 7
    print((ans - 1))

-import scipy.misc as scm -n = int(eval(input())) -s = list(eval(input())) -tmp = len(set(s)) -count_s = Counter(s) -count_s = count_s.most_common() -ans = 1 -for i in range(tmp): -    if count_s[i][1] > 1: -        ans *= count_s[i][1] + 1 -        ans = ans % (10**9 + 7) -    else: -        ans *= 2 -        ans = ans % (10**9 + 7) -ans -= 1 -print(ans) +if __name__ == "__main__": +    n = int(eval(input())) +    s = list(eval(input())) +    s = Counter(s) +    s = s.most_common() +    ans = 1 +    for k, v in s: +        if v > 1: +            ans *= v + 1 +        else: +            ans *= 2 +        ans %= 10**9 + 7 +    print((ans - 1))