#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
inline long long sub(long long a, long long b) {
  return (a % MOD - b % MOD + MOD) % MOD;
}
int32_t main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long i, j;
  long long n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  long long m = s.length();
  long long dp[n + m + 1];
  dp[0] = 1;
  long long lastVisited[k];
  memset(lastVisited, 0, sizeof(lastVisited));
  for (i = 1; i < m + 1; i++) {
    long long c = s[i - 1] - 'a';
    dp[i] = 2 * dp[i - 1];
    if (lastVisited[c]) dp[i] = sub(dp[i], dp[lastVisited[c] - 1]);
    lastVisited[c] = i;
  }
  for (i = 1; i < n + 1; i++) {
    long long idx = min_element(lastVisited, lastVisited + k) - lastVisited;
    dp[i + m] = 2 * dp[i + m - 1];
    if (lastVisited[idx]) dp[i + m] = sub(dp[i + m], dp[lastVisited[idx] - 1]);
    lastVisited[idx] = m + i;
  }
  cout << dp[m + n] % MOD << "\n";
  return 0;
}
