#include <bits/stdc++.h>
const int MAXN = 2e6 + 10;
const int mod = 1e9 + 7;
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 3) + (x << 1) + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
void write(int x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
int last[30], dp[MAXN];
signed main() {
  int n = read(), k = read(), m = 0;
  char ch;
  while ((ch = getchar()) != '\n') {
    ++m;
    if (!last[ch - 'a'])
      dp[m] = 1ll * (2ll * dp[m - 1] % mod + 1) % mod;
    else
      dp[m] =
          1ll * (2ll * dp[m - 1] % mod - dp[last[ch - 'a'] - 1] + mod) % mod;
    last[ch - 'a'] = m;
  }
  for (register int i = 1; i <= n; i++) {
    int minpos = 2e6 + 5, minletter = -1;
    for (register int j = 0; j < k; j++)
      if (last[j] < minpos) minletter = j, minpos = last[j];
    int now = i + m;
    if (!minpos)
      dp[now] = 1ll * (2ll * dp[now - 1] % mod + 1) % mod;
    else
      dp[now] = 1ll * (2ll * dp[now - 1] % mod - dp[minpos - 1] + mod) % mod;
    last[minletter] = now;
  }
  write((dp[n + m] + 1 % mod + mod) % mod);
  return 0;
}
