#include <bits/stdc++.h>

#define ll long long
#define ld long double
#define endl "\n"

using namespace std;

const ll mod=1e9+7;

ll add(ll x, ll y) {
    return ((x%mod)+(y%mod))%mod; ////////////////////////////////////
}

void solve()
{
    string s; cin >> s >> s;

    string x="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
//    if(s.size()<=26) {
//        cout << "0" << endl;
//        return;
//    }

    ll dp[27];
    memset(dp,0,sizeof(dp));

    dp[0]=1;

    for(int j=1;j<=s.size();j++) {
        ll r=1;
        for(int i=1;i<=26;i++) {
            ll temp=dp[i];

            if(x[i-1]==s[j-1])
                dp[i]=add(dp[i],r);

            r=temp;
        }
    }

    cout << dp[26] << endl;
}

int main()
{
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

    int t=1; //cin >> t;
    while(t--)
        solve();

    return 0;
}