#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool rd(T &ret) {
  char c;
  int sgn;
  if (c = getchar(), c == EOF) return 0;
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  sgn = (c == '-') ? -1 : 1;
  ret = (c == '-') ? 0 : (c - '0');
  while (c = getchar(), c >= '0' && c <= '9') ret = ret * 10 + (c - '0');
  ret *= sgn;
  return 1;
}
template <class T>
inline void pt(T x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x > 9) pt(x / 10);
  putchar(x % 10 + '0');
}
const int N = 1e6 + 10;
const int mod = 1e9 + 7;
int f2[N], len;
char s1[N], s2[N];
void getFail(int *f, char *P) {
  f[0] = f[1] = 0;
  for (int i = 1; i < len; i++) {
    int j = f[i];
    while (j && P[i] != P[j]) j = f[j];
    f[i + 1] = P[i] == P[j] ? j + 1 : 0;
  }
}
set<int> s;
void KMP(int *f, char *S1, char *S2) {
  getFail(f, S2);
  int j = 0, i = 0;
  while (i <= len) {
    while (j && S1[i] != S2[j]) j = f[j];
    i++, j++;
  }
  for (int i = len; f[i]; i = f[i]) s.insert(len - f[i]);
}
int m, n;
bool v[N];
int main() {
  while (cin >> n) {
    rd(m);
    scanf("%s", s1);
    while (m--) {
      int u;
      rd(u);
      v[u] = true;
    }
    len = strlen(s1);
    memcpy(s2, s1, sizeof s1);
    KMP(f2, s1, s2);
    long long ans = 1;
    for (int i = 1, last = -1e7; i <= n; i++) {
      if (v[i] == false && i - last >= len) {
        ans *= 26LL;
        if (ans >= mod) ans %= mod;
      } else if (v[i] == true) {
        if (i - last < len && !s.count(i - last)) {
          ans = 0;
          break;
        }
        last = i;
      }
    }
    pt(ans % mod);
    puts("");
  }
  return 0;
}
