#include <bits/stdc++.h>
using namespace std;
int n, m, k, last[30], id[30];
long long sum, dp[30];
char s[1000010];
inline bool cmp(int a, int b) { return last[a] < last[b]; }
int main() {
  memset(last, -1, sizeof(last));
  scanf("%d%d", &n, &m);
  scanf("%s", s + 1);
  k = strlen(s + 1);
  for (int i = 1; i <= k; i++) {
    int c = s[i] - 'a';
    last[c] = i;
    (sum -= dp[c]) %= 1000000007;
    (dp[c] += sum + 1) %= 1000000007;
    (sum += dp[c]) %= 1000000007;
  }
  for (int i = 0; i < m; i++) id[i] = i;
  sort(id, id + m, cmp);
  for (int i = 0; i < n; i++) {
    int c = id[i % m];
    (sum -= dp[c]) %= 1000000007;
    (dp[c] += sum + 1) %= 1000000007;
    (sum += dp[c]) %= 1000000007;
  }
  (sum += 1) %= 1000000007;
  printf("%lld\n", (sum + 1000000007) % 1000000007);
  return 0;
}
