# coding:utf-8



import sys

from collections import Counter, defaultdict



INF = float('inf')

MOD = 10 ** 9 + 7



def LI(): return [int(x) for x in sys.stdin.readline().split()]

def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]

def LS(): return sys.stdin.readline().split()

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

def SI(): return eval(input())





def main():

    n = II()

    s = SI()



    cnt = [0] * 27

    res = 0

    for c in s:

        k = ord(c) - 97

        cnt[k] += 1

        tmp = 1

        for i in range(27):

            if not cnt[i]:

                continue

            if i == k:

                continue

            tmp *= cnt[i] + 1

        res += tmp

        res %= MOD



    return res if res else MOD





print((main()))

# coding:utf-8



import sys

from collections import Counter, defaultdict



INF = float('inf')

MOD = 10 ** 9 + 7



def LI(): return [int(x) for x in sys.stdin.readline().split()]

def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]

def LS(): return sys.stdin.readline().split()

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

def SI(): return eval(input())





def main():

    n = II()

    s = SI()



    C = Counter(s)

    res = 1

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

        res *= c + 1

        res %= MOD



    return res - 1 if res else MOD - 1





print((main()))

# coding:utf-8
import sys
from collections import Counter, defaultdict

INF = float("inf")
MOD = 10**9 + 7


def LI():
    return [int(x) for x in sys.stdin.readline().split()]


def LI_():
    return [int(x) - 1 for x in sys.stdin.readline().split()]


def LS():
    return sys.stdin.readline().split()


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


def SI():
    return eval(input())


def main():
    n = II()
    s = SI()
    cnt = [0] * 27
    res = 0
    for c in s:
        k = ord(c) - 97
        cnt[k] += 1
        tmp = 1
        for i in range(27):
            if not cnt[i]:
                continue
            if i == k:
                continue
            tmp *= cnt[i] + 1
        res += tmp
        res %= MOD
    return res if res else MOD


print((main()))

# coding:utf-8
import sys
from collections import Counter, defaultdict

INF = float("inf")
MOD = 10**9 + 7


def LI():
    return [int(x) for x in sys.stdin.readline().split()]


def LI_():
    return [int(x) - 1 for x in sys.stdin.readline().split()]


def LS():
    return sys.stdin.readline().split()


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


def SI():
    return eval(input())


def main():
    n = II()
    s = SI()
    C = Counter(s)
    res = 1
    for c in list(C.values()):
        res *= c + 1
        res %= MOD
    return res - 1 if res else MOD - 1


print((main()))

-    cnt = [0] * 27 -    res = 0 -    for c in s: -        k = ord(c) - 97 -        cnt[k] += 1 -        tmp = 1 -        for i in range(27): -            if not cnt[i]: -                continue -            if i == k: -                continue -            tmp *= cnt[i] + 1 -        res += tmp +    C = Counter(s) +    res = 1 +    for c in list(C.values()): +        res *= c + 1 -    return res if res else MOD +    return res - 1 if res else MOD - 1