#include <bits/stdc++.h>

using namespace std;


int ar[26];

int main()
{
    int n;
    string str;
    cin >> n;
    cin >> str;
    bool f = true;
    char arr[n];
    strcpy(arr, str.c_str());
    if(n < 26)
    {
        cout << 0 << endl;
    }
    else
    {
        if(n == 26)
        {
            for(int i = 0; i < 26; i++)
            {
                int a  = arr[i];
                if(a != (65 + i))
                {
                    f = false;
                }
            }
            if(f)
            {
                cout << 1 << endl;
            }
            else
            {
                cout << 0 << endl;
            }
        }
        else
        {
            int k = 65;
            int v;
            for(int i = 0; i < n; i++)
            {
                v = arr[i];
                if(v == k)
                {
                    ar[k-65]++;
                }
                else if(v == k+1)
                {
                    k++;
                    ar[k-65]++;
                }
            }
            if(k != 90)
            {
                cout << 0 << endl;
            }
            else
            {
                long long d = 1;
                for(int i = 0; i < 26; i++)
                {
                    d*=(ar[i]);
                }
                cout << endl;
                long long l = pow(10, 9) + 7;
                double dd = d % l;
                cout << dd;
            }
        }
    }
    return 0;
}