#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const int MAXK = 26;
int N, K, last[MAXK], ord[MAXK];
long long dp[MAXK], sum;
string S;
bool comp(int a, int b) { return last[a] < last[b]; }
void append(int c) {
  sum = (sum - dp[c] + MOD) % MOD;
  dp[c] = (dp[c] + sum + 1) % MOD;
  sum = (sum + dp[c]) % MOD;
}
int main() {
  cin >> N >> K >> S;
  fill(last, last + K, -1);
  for (int i = 0; i < S.size(); i++) {
    int c = S[i] - 'a';
    last[c] = i;
    append(c);
  }
  iota(ord, ord + K, 0);
  sort(ord, ord + K, comp);
  for (int i = 0; i < N; i++) {
    int c = ord[i % K];
    append(c);
  }
  cout << (sum + 1) % MOD << '\n';
}
