#include <bits/stdc++.h>
using namespace std;
const int T = 1e9 + 7;
const int maxn = 1e6 + 233;
char s[maxn], t[maxn];
int nxt[maxn], ext[maxn], a[maxn], cnt[maxn * 2];
int n, m;
void get_nxt() {
  int po = 1, i = 0;
  nxt[0] = m;
  while (t[i] == t[i + 1] && i + 1 < m) i++;
  nxt[1] = i;
  for (int i = 2; i < m; i++) {
    if (nxt[i - po] + i < nxt[po] + po)
      nxt[i] = nxt[i - po];
    else {
      int j = nxt[po] + po - i;
      if (j < 0) j = 0;
      while (i + j < m && t[j] == t[i + j]) j++;
      nxt[i] = j;
      po = i;
    }
  }
  return;
}
void get_ext() {
  int po = 1, i = 0;
  while (s[i] == t[i] && i < n && i < m) i++;
  ext[0] = i;
  for (int i = 1; i < n; i++) {
    if (nxt[i - po] + i < ext[po] + po)
      ext[i] = nxt[i - po];
    else {
      int j = ext[po] + po - i;
      if (j < 0) j = 0;
      while (i + j < n && j < m && s[i + j] == t[j]) j++;
      ext[i] = j;
      po = i;
    }
  }
  return;
}
int main() {
  int N, k;
  cin >> N >> k;
  scanf("%s", s);
  n = strlen(s);
  for (int i = 0; i <= n; i++) t[i] = s[i];
  m = strlen(t);
  get_nxt();
  get_ext();
  for (int i = 1; i <= k; i++) {
    scanf("%d", &a[i]);
    if (i >= 2) {
      if (a[i] - a[i - 1] < n &&
          ext[a[i] - a[i - 1]] != n - (a[i] - a[i - 1])) {
        puts("0");
        return 0;
      }
    }
    cnt[a[i]]++;
    cnt[a[i] + n]--;
  }
  int cur = 0;
  long long ans = 1;
  for (int i = 1; i <= N; i++) {
    cur += cnt[i];
    if (cur == 0) {
      ans *= 26;
      ans %= T;
    }
  }
  cout << ans << endl;
  return 0;
}
