#include <bits/stdc++.h>
using namespace std;
int dp[27][5001], c[5001][5001];
int main() {
  int n, ans;
  string s;
  cin >> n >> s;
  dp[0][0] = 1;
  for (auto c : s) {
    int i = c - 'a' + 1;
    for (int j = 0; j <= n; j++)
      dp[0][j] = (dp[0][j] - dp[i][j] + 1000000007) % 1000000007;
    for (int j = 1; j <= n; j++) dp[i][j] = dp[0][j - 1];
    for (int j = 0; j <= n; j++) dp[0][j] = (dp[0][j] + dp[i][j]) % 1000000007;
  }
  c[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    c[i][0] = 1;
    for (int j = 1; j <= i; j++)
      c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % 1000000007;
  }
  ans = 0;
  for (int i = 1; i <= n; i++) {
    int ansx = (1ll * dp[0][i] * c[n - 1][i - 1]) % 1000000007;
    ans = (ans + ansx) % 1000000007;
  }
  cout << ans << '\n';
  return 0;
}
