#include <bits/stdc++.h>
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma comment(linker, "/stack:200000000")
using namespace std;
const int maxn = 2e6 + 5;
const long long mod = 1e9 + 7;
int p[27];
long long dp[maxn];
char s[maxn];
int main() {
  long long n, k;
  scanf("%I64d%I64d", &n, &k);
  scanf("%s", s + 2);
  s[1] = ' ';
  for (int i = 0; i < k; i++) p[i] = 1;
  int m = strlen(s + 1);
  dp[1] = 1;
  for (int i = 2; i <= m; i++) {
    dp[i] = (((dp[i - 1] << 1) - dp[p[s[i] - 'a'] - 1]) % mod + mod) % mod;
    p[s[i] - 'a'] = i;
  }
  int ops = m;
  for (int i = 1; i <= n; i++) {
    int g = 0;
    long long temp = p[0];
    for (int j = 1; j < k; j++) {
      if (p[j] < temp) temp = p[j], g = j;
    }
    dp[ops + 1] = (((dp[ops] << 1) - dp[p[g] - 1]) % mod + mod) % mod;
    p[g] = ++ops;
  }
  printf("%I64d\n", dp[ops]);
  return 0;
}
