#include <bits/stdc++.h>
using namespace std;

#define endl "\n"
#define ll long long
#define PB push_back
#define F first
#define S second
#define all(a) a.begin(), a.end()
#define MAX (int)1e6
#define Fast ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define w(a) cout<<#a<<" : "<<a<<endl;
#define ldb long double
#define vi vector<int>
#define pii pair<int,int>
#define pdi pair<ldb,int>
#define NMAX (int)1e6+5
#define INF (int)1'450'000

/// treci

int MOD=(int)1e9+7;

vector<vi> dp(NMAX,vi(27));

int solve(string x, string a)
{
    int n=26,m=x.size();
    if(m<n) return 0;
    for(int i=0; i<=m; ++i) dp[i][0]=1;
    for(int j=1; j<=n; ++j) dp[0][j]=0;
    for(int i=1; i<=m; ++i)
    {
        for(int j=1; j<=n; ++j)
        {
            dp[i][j]=dp[i-1][j];
            if(x[i-1]==a[j-1]) dp[i][j]+=dp[i-1][j-1];
            dp[i][j]%=MOD;
        }
    }
    return dp[m][n];
}

int main()
{
    Fast;
    string a="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    int n; cin>>n;
    string x; cin>>x;
    int ans=solve(x,a);
    //if(ans==1) ans=0;
    cout<<ans;
    return 0;
}