You are given a string S of length N. Among its subsequences, count the ones such that all characters are different, modulo 10^9+7. Two subsequences are considered different if their characters come from different positions in the string, even if they are the same as strings.  Here, a subsequence of a string is a concatenation of **one or more** characters from the string without changing the order.
from itertools import combinations

# input
n = int(input())
s = input()



def make_freq(s):
    freq_s = []
    uniq_s = set(s)
    for char in uniq_s:
        freq_s.append(s.count(char))

    # 0 padding
    freq_s.extend(0 for _ in range(n - len(uniq_s)))

    freq_s.sort(reverse=True)
    return freq_s

freq_s = make_freq(s)


# tuple product calc
def product(t):
    if len(t) == 0:
        return 0
    prod = 1
    for i in t:
        prod *= i
    return prod



print(sum(product(comb) for i in range(n) for comb in combinations(freq_s, i)))

from collections import Counter
N = int(input())
S = input()
MOD = 10**9 + 7

C = Counter(S)
ans = 1
for v in C.values():
    ans *= (v+1)
    ans %= MOD

print((ans-1) % MOD)
