#include <bits/stdc++.h>
using namespace std;
int n, m, match[1000005], ans;
string P, S;
char tmp[1000005];
long long H[1000005], Pow[1000005], key;
void Hash() {
  for (int i = Pow[0] = 1; i <= n; i++) {
    Pow[i] = Pow[i - 1] * 31ll % 1000000007ll;
    H[i] = (H[i - 1] * 31ll + S[i - 1] - 'a' + 1) % 1000000007ll;
  }
  for (int i = 0; i < P.size(); i++)
    key = (key * 31ll + P[i] - 'a' + 1) % 1000000007ll;
}
long long get(int l, int r) {
  long long res = (H[r] - H[l - 1] * Pow[r - l + 1]) % 1000000007ll;
  res = (res + 1000000007ll * 1000000007ll) % 1000000007ll;
  return res;
}
int main() {
  srand(time(0));
  int x;
  scanf("%d %d", &n, &m);
  scanf("%s", tmp);
  P = tmp;
  for (int i = 1; i <= m; i++) {
    scanf("%d", &x);
    match[x] = 1;
  }
  int cur = 1e7;
  for (int i = 1; i <= n; i++) {
    cur++;
    if (match[i]) cur = 0;
    if (cur < P.size())
      S += P[cur];
    else {
      S += 'z' + 1;
      ans++;
    }
  }
  Hash();
  for (int i = 1; i <= n; i++)
    if (match[i] && get(i, i + P.size() - 1) != key) {
      printf("0\n");
      return 0;
    }
  long long res = 1;
  while (ans--) res = res * 26ll % 1000000007ll;
  cout << res << endl;
  return 0;
}
