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;
map<string, long long int> mark;
void EE(long long int a, long long int b, long long int& x, long long int& y) {
  if (a % b == 0) {
    x = 0;
    y = 1;
    return;
  }
  EE(b, a % b, x, y);
  long long int temp = x;
  x = y;
  y = temp - y * (a / b);
}
long long int inverse(long long int a, long long int m) {
  long long int x, y;
  EE(a, m, x, y);
  if (x < 0) x += m;
  return x;
}
int inv[200000], fact[200000], dp[30][6000];
string c;
char s[200000];
int main() {
  long long int n;
  string s;
  fact[0] = 1;
  inv[0] = 1;
  for (int i = 1; i < 200000; i++) {
    fact[i] = ((long long int)fact[i - 1] * (long long int)i) % 1000000007;
    inv[i] =
        ((long long int)inverse(i, 1000000007) * (long long int)inv[i - 1]) %
        1000000007;
  }
  cin >> n;
  int total = n;
  cin >> s;
  int f = 0;
  c.push_back(s[0]);
  for (int i = 1; i < n; i++) {
    if (s[i] != s[i - 1]) {
      c.push_back(s[i]);
    }
  }
  n = c.size();
  for (int i = (n - 1); i >= 0; i--) {
    int upd = (c[i] - 'a');
    dp[upd][1] = 1;
    for (int j = 2; j <= (n - i); j++) {
      int val = 0;
      for (int k = 0; k < 26; k++) {
        if (k != upd) val = (val + dp[k][j - 1]) % 1000000007;
      }
      dp[upd][j] = val;
    }
  }
  int ans = 0;
  for (int i = 0; i < 26; i++) {
    for (int j = 1; j <= n; j++) {
      int x = (total - j);
      int r = j;
      int val = ((long long int)fact[x + r - 1] * (long long int)inv[r - 1]) %
                1000000007;
      val = ((long long int)val * (long long int)inv[x]) % 1000000007;
      val = ((long long int)val * (long long int)dp[i][j]) % 1000000007;
      ans = (ans + val) % 1000000007;
    }
  }
  cout << ans;
}
