#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
const long long mod = 1e9 + 7;
char s[N], t[N];
int nx[N];
int len1, len2, n, m, w[N], c = 0;
void get_next() {
  int k = 0;
  for (int i = 1; i < len2; i++) {
    while (k > 0 && t[k] != t[i]) k = nx[k - 1];
    if (t[k] == t[i]) k++;
    nx[i] = k;
  }
}
void kmp() {
  int k = 0;
  for (int i = 0; i < n; i++) {
    while (k > 0 && t[k] != s[i]) k = nx[k - 1];
    if (t[k] == s[i]) k++;
    if (k == len2) {
      if (binary_search(w, w + m, i - k + 1)) c++;
    }
  }
}
int main() {
  cin >> n >> m;
  scanf("%s", t);
  len2 = strlen(t);
  for (int i = 0; i < n; i++) s[i] = '?';
  s[n] = '\0';
  for (int i = 0; i < m; i++) scanf("%d", &w[i]), w[i] -= 1;
  sort(w, w + m);
  m = unique(w, w + m) - w;
  int last = -1;
  for (int i = 0; i < m; i++) {
    if (w[i] + len2 - 1 > last) {
      int start = w[i], dis = 0;
      if (last + 1 > w[i]) {
        dis = last + 1 - w[i];
        start = last + 1;
      }
      for (int j = start; j <= w[i] + len2 - 1; j++) s[j] = t[j - start + dis];
      last = w[i] + len2 - 1;
    }
  }
  get_next();
  kmp();
  if (c < m) {
    puts("0");
    return 0;
  }
  long long res = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '?') res += 1;
  }
  long long ans = 1;
  for (int i = 1; i <= res; i++) {
    ans = (ans * (long long)26) % mod;
  }
  cout << ans << endl;
  return 0;
}
