#include <iostream>
#define MOD 1000000007

using namespace std;

int dp[100005][27];

int main()
{
    int n;
    cin >> n;
    string s;
    cin >> s;
    for (int i = 0; i <= n; ++i)
        dp[i][0] = 1;
    for (int i = 1; i <= n; ++i){
        for (int j = 1; j <= 26; ++j){
            if (s[i-1] - 'A' == j-1) dp[i][j] = (dp[i-1][j-1] + dp[i-1][j]) % MOD;
            else dp[i][j] = dp[i-1][j];
        }
    }
    cout << dp[n][26];
    return 0;
}