#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long n, m=0, k=0, br=0;
    cin >> n;
    string s;

    cin >> s;
    m = n-26-1;
    k = pow(2,m);
    if(n<=26){
        for(int i = 0; i < n; i++){
            if(s[i] == s[i-1])
                br++;}
        if(br>0)
            cout << 0;
        else
            cout << 1;}
    else if(n<=26){
        for(int i = 0; i < n; i++){
            if(s[i] == s[i-1])
                br++;}
        if(br>1)
            cout << 0;
        else
            cout << 1;}
    else
        cout << k % 1000000007;
    return 0;
}