#include <bits/stdc++.h>
int n;
char s[100005];
int a = 0, t = 0, c = 0, g = 0, max = 0;
long long f = 0;
long long quick_pow() {
  long long re = 1;
  while (n != 0) {
    if (n & 1) re *= f, re %= 1000000007;
    f = (f * f);
    f %= 1000000007;
    n >>= 1;
  }
  re %= 1000000007;
  return re;
}
int main() {
  int i;
  scanf("%d%s", &n, &s);
  char ch;
  for (i = 0; i < n; i++) {
    ch = s[i];
    if (ch == 'A')
      a++;
    else if (ch == 'G')
      g++;
    else if (ch == 'T')
      t++;
    else if (ch == 'C')
      c++;
  }
  if (a > max) max = a;
  if (t > max) max = t;
  if (g > max) max = g;
  if (c > max) max = c;
  if (a == max) f++;
  if (t == max) f++;
  if (g == max) f++;
  if (c == max) f++;
  printf("%I64d ", quick_pow());
  return 0;
}
