15
txxtxttxxttxtxx
 3
myw
 127
xixtxixnxixtxixlxixtxixnxixtxixoxixtxixnxixtxixlxixtxixnxixtxixhxixtxixnxixtxixlxixtxixnxixtxixoxixtxixnxixtxixlxixtxixnxixtxix
 1
a
 10
isssisssss
 2
ff
 1
z

27824
 10
 944124121
 1
 176
 1
 1

#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-10;
const double pi = 3.1415926535897932384626433832795;
const double eln = 2.718281828459045235360287471352;
const long long mod = 1e9 + 7;
long long c[5005][5005];
char s[5005], s1[5005];
long long dp[5005][27];
int i, j, k, l, m, n;
long long ans;
int main() {
  c[1][0] = c[1][1] = 1;
  scanf("%d\n", &n);
  for (i = 2; i <= n; i++) {
    c[i][0] = c[i][i] = 1;
    for (j = 1; j <= i - 1; j++)
      c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % mod;
  }
  gets(s1 + 1);
  m = 1;
  s[1] = s1[1];
  for (i = 2; i <= n; i++)
    if (s1[i] != s1[i - 1]) s[++m] = s1[i];
  for (i = 1; i <= m; i++) {
    dp[1][s[i] - 96] = 1;
    for (k = 2; k <= i; k++) {
      dp[k][s[i] - 96] = 0;
      for (j = 1; j <= 26; j++) {
        if (j == s[i] - 96) j++;
        dp[k][s[i] - 96] += dp[k - 1][j];
        dp[k][s[i] - 96] %= mod;
      }
    }
  }
  for (i = 1; i <= 26; i++)
    for (j = 1; j <= m; j++) {
      ans += (dp[j][i] * c[n - 1][j - 1]) % mod;
      ans %= mod;
    }
  printf("%lld", ans);
  return 0;
}
