def slove():

    import sys

    import collections

    input = sys.stdin.readline

    n = int(input().rstrip('\n'))

    s = collections.Counter(str(input().rstrip('\n')))

    cnt = 1

    for k, v in list(s.items()):

        cnt *= (v + 1)

        cnt %= (10 ** 9 + 7)

    print((cnt - 1))





if __name__ == '__main__':

    slove()

def slove():

    import sys

    import collections

    input = sys.stdin.readline

    n = int(input().rstrip('\n'))

    s = str(input().rstrip('\n'))

    s = collections.Counter(s).most_common()

    t = 1

    for k, v in s:

        t = (t * (v + 1)) % (10 ** 9 + 7)

    print((t - 1))





if __name__ == '__main__':

    slove()

def slove():
    import sys
    import collections

    input = sys.stdin.readline
    n = int(input().rstrip("\n"))
    s = collections.Counter(str(input().rstrip("\n")))
    cnt = 1
    for k, v in list(s.items()):
        cnt *= v + 1
        cnt %= 10**9 + 7
    print((cnt - 1))


if __name__ == "__main__":
    slove()

def slove():
    import sys
    import collections

    input = sys.stdin.readline
    n = int(input().rstrip("\n"))
    s = str(input().rstrip("\n"))
    s = collections.Counter(s).most_common()
    t = 1
    for k, v in s:
        t = (t * (v + 1)) % (10**9 + 7)
    print((t - 1))


if __name__ == "__main__":
    slove()

-    s = collections.Counter(str(input().rstrip("\n"))) -    cnt = 1 -    for k, v in list(s.items()): -        cnt *= v + 1 -        cnt %= 10**9 + 7 -    print((cnt - 1)) +    s = str(input().rstrip("\n")) +    s = collections.Counter(s).most_common() +    t = 1 +    for k, v in s: +        t = (t * (v + 1)) % (10**9 + 7) +    print((t - 1))