#include <iostream>
#include <string>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char** argv) {
	
	int n;
	cin>>n;
	int brpon[26];
	int cnt=0;
	int asc=65;
	long long brkom=1;
	long long delj=10*10*10*10*10*10*10*10*10+7;
	string a;
	cin>>a;
	for(int i=0;i<26;i++){
		brpon[i]=0;
		while(a[cnt]!=char(asc)){
			cnt++;
		}
		while(a[cnt]==char(asc)){
			cnt++;
			brpon[i]++;
		}
		asc++;
		brkom*=brpon[i];
		brkom=brkom%delj;
	}
	
	cout<<brkom;

	return 0;
}