#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000000 + 7;
const int maxn = 1000000 + 6;
int n;
int k;
char s[maxn];
int f[maxn << 1];
int lst[33];
priority_queue<int, vector<int>, greater<int> > Q;
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> k >> s;
  int len = strlen(s);
  f[0] = 1;
  for (int i = 0; i < len; i++) {
    f[i + 1] = (1ll * f[i] * 2) % mod;
    if (lst[s[i] - 'a'])
      f[i + 1] =
          (1ll * f[i + 1] - 1ll * f[lst[s[i] - 'a'] - 1] + 1ll * mod) % mod;
    lst[s[i] - 'a'] = i + 1;
  }
  for (int i = 0; i < k; i++) Q.push(lst[i]);
  for (int i = 0; i < n; i++) {
    int p = Q.top();
    Q.pop();
    f[len + 1 + i] = (1ll * f[len + i] * 2) % mod;
    f[len + 1 + i] = (1ll * f[len + 1 + i] - 1ll * f[p - 1] + 1ll * mod) % mod;
    Q.push(len + 1 + i);
  }
  cout << f[len + n] << "\n";
  return 0;
}
