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 ll = long long;
const int MAXN = 5555;
const int MOD = 1000000007;
int fact[MAXN], rev[MAXN];
int dp[33][MAXN];
int sum[MAXN];
int N;
std::string str;
ll power(ll x, ll y, ll m) {
  if (y == 0) return 1;
  ll p = power(x, y / 2, m) % m;
  p = (p * p) % m;
  return (y % 2 == 0) ? p : (x * p) % m;
}
ll inv_mod(ll a, ll m) { return power(a, m - 2, m); }
int choose(int a, int b) {
  int ret = fact[a];
  ret = ((ll)ret * rev[b]) % MOD;
  ret = ((ll)ret * rev[a - b]) % MOD;
  return ret;
}
void solve() {
  for (int x = 0; x < str.size(); ++x) {
    int cur = str[x] - 'a';
    dp[cur][1] = 1;
    for (int l = 2; l <= str.size(); ++l) {
      dp[cur][l] = 0;
      for (int j = 0; j < 26; ++j) {
        if (j == cur) continue;
        dp[cur][l] = (dp[cur][l] + dp[j][l - 1]) % MOD;
      }
    }
  }
}
void optimized() {
  sum[0] = 1;
  for (int x = 0; x < str.size(); ++x) {
    int cur = str[x] - 'a';
    for (int l = str.size(); l >= 0; --l) {
      sum[l + 1] = (sum[l + 1] - dp[cur][l + 1] + MOD) % MOD;
      dp[cur][l + 1] = (sum[l] - dp[cur][l] + MOD) % MOD;
      sum[l + 1] = (sum[l + 1] + dp[cur][l + 1]) % MOD;
    }
  }
}
int main() {
  fact[0] = 1;
  rev[0] = inv_mod(fact[0], MOD);
  for (int i = 1; i < MAXN; ++i) {
    fact[i] = ((ll)fact[i - 1] * i) % MOD;
    rev[i] = inv_mod(fact[i], MOD);
  }
  std::ios_base::sync_with_stdio(false);
  std::cin >> N;
  std::cin >> str;
  str.erase(std::unique(str.begin(), str.end()), str.end());
  optimized();
  ll ret = 0;
  for (int l = 1; l <= str.size(); ++l) {
    for (int i = 0; i < 26; ++i) {
      ret = (ret + (ll)dp[i][l] * choose(N - 1, l - 1)) % MOD;
    }
  }
  std::cout << ret << std::endl;
}
