Julia is conducting an experiment in her lab. She placed several luminescent bacterial colonies in a horizontal testtube. Different types of bacteria can be distinguished by the color of light they emit. Julia marks types of bacteria with small Latin letters "a", ..., "z".

The testtube is divided into n consecutive regions. Each region is occupied by a single colony of a certain bacteria type at any given moment. Hence, the population of the testtube at any moment can be described by a string of n Latin characters.

Sometimes a colony can decide to conquer another colony in one of the adjacent regions. When that happens, the attacked colony is immediately eliminated and replaced by a colony of the same type as the attacking colony, while the attacking colony keeps its type. Note that a colony can only attack its neighbours within the boundaries of the testtube. At any moment, at most one attack can take place.

For example, consider a testtube with population "babb". There are six options for an attack that may happen next:

  * the first colony attacks the second colony (1 → 2), the resulting population is "bbbb";
  * 2 → 1, the result is "aabb";
  * 2 → 3, the result is "baab";
  * 3 → 2, the result is "bbbb" (note that the result is the same as the first option);
  * 3 → 4 or 4 → 3, the population does not change.



The pattern of attacks is rather unpredictable. Julia is now wondering how many different configurations of bacteria in the testtube she can obtain after a sequence of attacks takes place (it is possible that no attacks will happen at all). Since this number can be large, find it modulo 109 + 7.

Input

The first line contains an integer n — the number of regions in the testtube (1 ≤ n ≤ 5 000).

The second line contains n small Latin letters that describe the initial population of the testtube.

Output

Print one number — the answer to the problem modulo 109 + 7.

Examples

Input

3
aaa


Output

1


Input

2
ab


Output

3


Input

4
babb


Output

11


Input

7
abacaba


Output

589

Note

In the first sample the population can never change since all bacteria are of the same type.

In the second sample three configurations are possible: "ab" (no attacks), "aa" (the first colony conquers the second colony), and "bb" (the second colony conquers the first colony).

To get the answer for the third sample, note that more than one attack can happen.
#include <bits/stdc++.h>
using namespace std;
const long long N = 5e3 + 10, K = 30, MOD = 1e9 + 7;
long long fac[N + 1], inv[N + 1], dp[N][N], ps[N], R[K];
long long mul(long long a, long long b) {
  a %= MOD, b %= MOD;
  return (a * b) % MOD;
}
long long Pow(long long a, long long b) {
  long long r = 1;
  for (; b; b >>= 1, a = mul(a, a))
    if (b & 1) r = mul(r, a);
  return r;
}
long long C(long long n, long long k) {
  if (k > n || k < 0 || n < 0) return 0;
  return mul(fac[n], mul(inv[k], inv[n - k]));
}
int32_t main() {
  fac[0] = 1;
  for (long long i = 1; i <= N; i++) fac[i] = mul(fac[i - 1], i);
  inv[N] = Pow(fac[N], MOD - 2);
  for (long long i = N - 1; i >= 0; i--) inv[i] = mul(inv[i + 1], i + 1);
  long long n;
  cin >> n;
  string s;
  cin >> s;
  for (long long i = 1; i <= n; i++) {
    long long c = s[i - 1] - 'a';
    dp[i][1] = 1;
    for (long long j = 2; j <= i; j++)
      dp[i][j] = (ps[j - 1] - dp[R[c]][j - 1] + MOD) % MOD;
    for (long long j = 1; j <= i; j++)
      ps[j] = (ps[j] - dp[R[c]][j] + dp[i][j] + MOD) % MOD;
    R[c] = i;
  }
  long long ans = 0;
  for (long long i = 0; i < 26; i++)
    for (long long j = 1; j <= n; j++) {
      ans += mul(dp[R[i]][j], C(n - 1, j - 1));
      ans %= MOD;
    }
  cout << ans << "\n";
}
