#include <iostream>
//#include <iomanip>
//#include <cmath>
//#include <algorithm>
//#include <string>
//#include <vector>
//#include <ctime>
//#include <cstdlib>
//#include <limits>
//#include <mycpp.h>
#define MOD 1000000007

typedef unsigned long long ull;

using namespace std;

ull Fak[1000000]={0};

ull Faktorijal(ull n)
{
	if(n<=1)
		return 1;
	if(Fak[n]!=0)
		return Fak[n];
	Fak[n]=n*Faktorijal(n-1);
	return Fak[n];
}

int main()
{
	int n;
	cin>>n;
	string s;
	cin>>s;
	bool slovo[26]={false};
	int pon[26]={0};
	int obavezno=0;
	for(int i=0;i<n;i++)
	{
		if(!slovo[s[i]-'A'])
		{
			slovo[s[i]-'A']=true;
			continue;
		}
		if(slovo[s[i]-'A'+1])
		{
			obavezno++;
			continue;
		}
		pon[s[i]-'A']++;
	}
	ull k=0;
	ull l=0;
	for(int i=0;i<26;i++)
	{
		k+=pon[i];
		if(pon[i]!=0)
			l++;
	}
	ull a=k+l+obavezno,b=k+obavezno;
	cout<<((Faktorijal(a))/(Faktorijal(b))/(Faktorijal(a-b)))%MOD;
}