from collections import Counter,defaultdict,deque

from heapq import heappop,heappush,heapify

import sys,bisect,math,itertools,fractions,pprint

sys.setrecursionlimit(10**8)

mod = 10**9+7

INF = float('inf')

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))

def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))



n = inp()

s = eval(input())

c = Counter(s)

res = 1

for key in list(c):

    res *= c[key]+1

    res %= mod

print((res-1))
from collections import Counter,defaultdict,deque

from heapq import heappop,heappush

from bisect import bisect_left,bisect_right 

import sys,math,itertools,fractions

sys.setrecursionlimit(10**8)

mod = 10**9+7

INF = float('inf')

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))



n = inp()

s = eval(input())

c = Counter(s)

# print(c)

res = 1

for v in list(c.values()):

    # print(v)

    res *= v+1

    res %= mod

print((res-1))
from collections import Counter, defaultdict, deque
from heapq import heappop, heappush, heapify
import sys, bisect, math, itertools, fractions, pprint

sys.setrecursionlimit(10**8)
mod = 10**9 + 7
INF = float("inf")


def inp():
    return int(sys.stdin.readline())


def inpl():
    return list(map(int, sys.stdin.readline().split()))


def inpln(n):
    return list(int(sys.stdin.readline()) for i in range(n))


n = inp()
s = eval(input())
c = Counter(s)
res = 1
for key in list(c):
    res *= c[key] + 1
    res %= mod
print((res - 1))

from collections import Counter, defaultdict, deque
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right
import sys, math, itertools, fractions

sys.setrecursionlimit(10**8)
mod = 10**9 + 7
INF = float("inf")


def inp():
    return int(sys.stdin.readline())


def inpl():
    return list(map(int, sys.stdin.readline().split()))


n = inp()
s = eval(input())
c = Counter(s)
# print(c)
res = 1
for v in list(c.values()):
    # print(v)
    res *= v + 1
    res %= mod
print((res - 1))

-from heapq import heappop, heappush, heapify -import sys, bisect, math, itertools, fractions, pprint +from heapq import heappop, heappush +from bisect import bisect_left, bisect_right +import sys, math, itertools, fractions -def inpln(n): -    return list(int(sys.stdin.readline()) for i in range(n)) - - +# print(c) -for key in list(c): -    res *= c[key] + 1 +for v in list(c.values()): +    # print(v) +    res *= v + 1