#include <bits/stdc++.h>

using namespace std;

#define MOD 1000000007

int count(string s, string abeceda,int n)
{
    int matrica[n+1][27]={{0}};
    for (int i=0; i<=26; i++)
        matrica[0][i]=0;
    for (int i = 0; i<=n; i++)
        matrica[i][0] = 1;
    for (int i=1; i<=n; i++)
    {
        for (int j=1; j<=26; j++)
        {
            if (s[i-1]==abeceda[j-1])
                matrica[i][j]=matrica[i-1][j-1]%MOD+matrica[i-1][j]%MOD;

            else
                matrica[i][j]=matrica[i-1][j]%MOD;
        }
    }
    return matrica[n][26];
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin>>n;
    string s;
    cin>>s;
    string abeceda="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    cout<<count(s,abeceda,n);
    return 0;
}