#include <bits/stdc++.h> 
using namespace std; 
#define mod 1000000007
long long brojNacina(string a,int n) 
{ 
	string abc="ABCDEFGHIJKLMNOPQRSTUVWXYZ"; 
	
	long long brojac[26][n]; 
	
	memset(brojac, 0, sizeof(brojac)); 

	for (int i=0;i<26;i++) 
	{ 
		for (int j=i;j<n;j++) 
		{  
			if (i==0) 
			{ 
				if (j==0)
				{
					if(a[j]==abc[i])
					{
						brojac[i][j]=1;
					}
					else
					{
						brojac[i][j]=0;
					}
				}
				else if (a[j]==abc[i])
				{ 
					brojac[i][j]=brojac[i][j-1]+1;
				}
				else
				{
					brojac[i][j]=brojac[i][j-1];
				}
			} 
			else 
			{ 
				if (a[j] == abc[i])
				{
					brojac[i][j]=brojac[i][j-1]+brojac[i-1][j-1]; 
				} 
				else
				{
					brojac[i][j]=brojac[i][j-1]; 
				}
			}
			if (brojac[i][j]>mod)
				{
					brojac[i][j]=brojac[i][j]%mod;
				}
		}
	}
	return brojac[25][n-1]; 
} 
int main() 
{ 
	ios::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);
	string a;
	int n;
	cin>>n;
	cin>>a;
	cout<<brojNacina(a,n)%mod;
}