#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mod 1000000007
int n, c = 0, x = 0, len = 0; ll total = 1, sum = 0;
char a[2007];
int cnt[30], tmp[30];
inline ll power(ll a, ll b) {
ll ans = 1;
while(b) {
if(b & 1) ans = (ans * a) % mod;
a = (a * a) % mod;
b >>= 1;
}
return ans;
}
inline ll work(int l, int r) {
ll res = 1;
for(int i = l; i <= r; i++)
res = res * i % mod;
return res;
}
inline ll A(int n, int m) {
if(n == 0) return 1;
ll res = work(m - n + 1, m);
return res * power(total, mod - 2) % mod;
}
int main() {
cin >> n >> (a + 1);
len = strlen(a + 1);
for(int i = 1; i <= n; i++) total = (total * i) % mod;
for(int i = 1; i <= n; i++) cnt[a[i] - 'a' + 1]++;
for(int i = 1; i <= 26; i++)
if(cnt[i] % 2 == 1) c++, x = i;
if(c >= 2) { cout << total; return 0; }
for(int i = 1; i <= 26; i++)
tmp[i] = cnt[i] / 2;
ll ans = 1, left = len / 2;
for(int i = 1; i <= 26; i++) {
if(left == 0) break;
ans = ans * A(cnt[i] / 2, left) % mod * work(1, cnt[i]) % mod;
left -= cnt[i] / 2;
}
cout << ((total - ans) % mod + mod) % mod;
return 0;
}