n=int(input())
s=input()
ca=cb=cc=cd=0
for c in s:
ca+=(c == 'A')
cb+=(c == 'C')
cc+=(c == 'G')
cd+=(c == 'T')
m = max(ca, cb, cc, cd)
count = (ca == m) + (cb == m) + (cc == m) + (cd == m)
print ((count**n) % int(1e9+7))
1215C - Swap Letters | 1251C - Minimize The Integer |
1494B - Berland Crossword | 295A - Greg and Array |
1433E - Two Round Dances | 1612D - X-Magic Pair |
41B - Martian Dollar | 906C - Party |
774F - Pens And Days Of Week | 598B - Queries on a String |
1303B - National Project | 1303D - Fill The Bag |
1198B - Welfare State | 1739B - Array Recovery |
1739C - Card Game | 1739A - Immobile Knight |
1739D - Reset K Edges | 817B - Makes And The Product |
1452C - Two Brackets | 400B - Inna and New Matrix of Candies |
870B - Maximum of Maximums of Minimums | 1600E - Array Game |
1149A - Prefix Sum Primes | 277A - Learning Languages |
769A - Year of University Entrance | 1738A - Glory Addicts |
1738C - Even Number Addicts | 1064B - Equations of Mathematical Magic |
384A - Coder | 1738B - Prefix Sum Addicts |