#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long dp[2000006];
int pos[26], fre[26];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, k;
  cin >> n >> k;
  for (int i = 0; i <= 25; i++) fre[i] = 0;
  string t;
  cin >> t;
  for (int i = 0; i < t.length(); i++) {
    fre[t[i] - 'a']++;
  }
  int cnt = 0;
  for (int i = 0; i < k; i++) {
    if (fre[i] != 0) cnt++;
  }
  int remain = k - cnt;
  for (int i = 0; i < k; i++) pos[i] = -1;
  dp[0] = 1;
  for (int i = 1; i <= t.length(); i++) {
    int ch = t[i - 1] - 'a';
    if (pos[ch] == -1) {
      dp[i] = (2 * dp[i - 1]) % mod;
      pos[ch] = i;
    } else {
      dp[i] = (2 * dp[i - 1]) % mod;
      dp[i] = (dp[i] - dp[pos[ch] - 1]) % mod;
      pos[ch] = i;
    }
  }
  long long curr = dp[(int)t.length()];
  set<pair<int, long long> > s;
  for (int i = 0; i < k; i++) {
    if (fre[i] != 0) {
      s.insert(make_pair(pos[i], dp[pos[i] - 1]));
    }
  }
  int m = (int)t.length();
  if (n >= remain) {
    for (int i = 0; i < remain; i++) {
      s.insert(make_pair(i + m + 1, curr));
      curr = (curr * 2) % mod;
    }
    for (int i = 0; i < max(0, n - remain); i++) {
      long long sub = (*s.begin()).second;
      s.erase(s.begin());
      s.insert(make_pair(i + m + remain + 1, curr));
      curr = (2 * curr) % mod;
      curr = (curr - sub) % mod;
    }
    cout << (curr + mod) % mod << "\n";
    return 0;
  }
  for (int i = 0; i < n; i++) curr = (curr * 2) % mod;
  cout << (curr + mod) % mod << "\n";
  return 0;
}
