#include <bits/stdc++.h>
using namespace std;
long long N;
char Str[100005];
long long Ap[30];
long long DP[100005][10];
vector<long long> V;
void Read() {
  cin >> N;
  char ch;
  cin.get(ch);
  cin.getline(Str, 100005);
}
void getAp() {
  for (long long i = 0; i < N; i++) Ap[Str[i] - 'A']++;
}
void getV() {
  V.push_back(Ap[0]);
  V.push_back(Ap['C' - 'A']);
  V.push_back(Ap['G' - 'A']);
  V.push_back(Ap['T' - 'A']);
  sort(V.begin(), V.end());
}
long long Solve(long long N, long long K) {
  long long sum = 0;
  for (int i = 1; i <= K; i++) DP[1][i] = 1;
  for (int i = 2; i <= N; i++)
    for (int j = 1; j <= K; j++) {
      for (int k = 1; k <= K; k++) DP[i][j] += DP[i - 1][k];
      DP[i][j] %= 1000000007;
    }
  for (int i = 1; i <= K; i++) sum += DP[N][i];
  return sum % 1000000007;
}
int main() {
  Read();
  getAp();
  getV();
  int i;
  for (i = 3; i >= 0; i--) {
    if (i == 0 || V[i] != V[i - 1]) break;
  }
  cout << Solve(N, V.size() - i) << "\n";
  return 0;
}
