#include <iostream>
#include <vector>

using namespace std;

int main() {
    int n;
    cin >> n;
    char *s = new char[n + 1];
    cin.getline(s,0);
    cin.getline(s, n + 1);
    const unsigned p = 1000000007;
    long long **dp = new long long *[n + 1];
    for (int i = 0; i <= n; i++)
        dp[i] = new long long[27];


    for (int i = 1; i <= n; i++)
        dp[i][s[i - 1] - 'A' + 1] = -1;
    for (int i = 0; i < 27; i++)
        dp[0][i] = 0;
    for (int i = 0; i <= n; i++)
        dp[i][0] = 1;

    for (int i = 1; i <= n; i++)
        for (int j = 1; j < 27; j++) {
            if (dp[i][j] == -1)
                dp[i][j] = (dp[i - 1][j - 1] + dp[i - 1][j]) % p;
            else
                dp[i][j] = dp[i - 1][j];
        }
    cout << dp[n][26];


    delete[] s;
    for (int i = 0; i < n; i++)
        delete[] dp[i];
    delete[] dp;
    return 0;
}