# AGC031A - Colorful Subsequence

from functools import reduce





def main():

    _ = int(eval(input()))

    S = input().rstrip()

    MOD = 10 ** 9 + 7

    C = [S.count(i) + 1 for i in set(S)]

    ans = reduce(lambda x, y: (x * y) % MOD, C)

    print((ans - 1))





if __name__ == "__main__":

    main()
# AGC031A - Colorful Subsequence

def main():

    _ = int(eval(input()))

    S = input().rstrip()

    MOD = 10 ** 9 + 7

    ans = 1

    for i in set(S):

        ans *= S.count(i) + 1

    print((ans % MOD - 1))





if __name__ == "__main__":

    main()
# AGC031A - Colorful Subsequence
from functools import reduce


def main():
    _ = int(eval(input()))
    S = input().rstrip()
    MOD = 10**9 + 7
    C = [S.count(i) + 1 for i in set(S)]
    ans = reduce(lambda x, y: (x * y) % MOD, C)
    print((ans - 1))


if __name__ == "__main__":
    main()

# AGC031A - Colorful Subsequence
def main():
    _ = int(eval(input()))
    S = input().rstrip()
    MOD = 10**9 + 7
    ans = 1
    for i in set(S):
        ans *= S.count(i) + 1
    print((ans % MOD - 1))


if __name__ == "__main__":
    main()

-from functools import reduce - - -    C = [S.count(i) + 1 for i in set(S)] -    ans = reduce(lambda x, y: (x * y) % MOD, C) -    print((ans - 1)) +    ans = 1 +    for i in set(S): +        ans *= S.count(i) + 1 +    print((ans % MOD - 1))