#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 5;
const long long MOD = 1e9 + 7;
long long soma[MAXN];
long long tudo = 0;
char v[MAXN];
int ult[30], perm[30];
int n, m, x;
bool cmp(int a, int b) { return ult[a] < ult[b]; }
int main() {
  scanf("%d %d", &m, &x);
  scanf(" %s", v + 1);
  n = strlen(v + 1);
  tudo = 1;
  for (int i = 1; i <= n; i++) {
    int cur = v[i] - 'a' + 1;
    ult[cur] = i;
    long long aux = soma[cur];
    soma[cur] = tudo;
    tudo += tudo - aux;
    tudo %= MOD;
  }
  for (int i = 0; i < x; i++) perm[i] = i + 1;
  sort(perm, perm + x, cmp);
  for (int i = 0; i < m; i++) {
    int cur = perm[i % x];
    long long aux = soma[cur];
    soma[cur] = tudo;
    tudo += tudo - aux;
    tudo %= MOD;
  }
  while (tudo < 0) tudo += MOD;
  printf("%lld\n", tudo);
}
