def slove():

    import sys

    import collections

    input = sys.stdin.readline

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

    a = list(str(input().rstrip('\n')))

    a = collections.Counter(a)

    cnt = 1

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

        cnt = (cnt * (v + 1) % (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 = collections.Counter(str(input().rstrip('\n')))

    t = 1

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

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


if __name__ == "__main__":
    slove()

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