#include <bits/stdc++.h>
using namespace std;
const int LEN = 1 << 21;
char BUF[LEN], *Pin, *Pin_last, PUF[LEN], *Pout = PUF,
                                          *Pout_last = PUF + LEN - 1;
inline char G() {
  return Pin == Pin_last && (Pin_last = (Pin = BUF) + fread(BUF, 1, LEN, stdin),
                             Pin == Pin_last)
             ? EOF
             : *Pin++;
}
inline void P(char x) {
  if (Pout == Pout_last) fwrite(PUF, 1, Pout - PUF, stdout), Pout = PUF;
  *Pout++ = x;
}
inline int read() {
  register int res = 0, f = 1, ch = ' ';
  while ((ch < '0' || ch > '9') && ch != EOF) {
    if (ch == '-') f = -1;
    ch = G();
  }
  while (ch >= '0' && ch <= '9')
    res = (res << 3) + (res << 1) + ch - 48, ch = G();
  return res * f;
}
inline long long readL() {
  register long long res = 0, f = 1, ch = ' ';
  while ((ch < '0' || ch > '9') && ch != EOF) {
    if (ch == '-') f = -1;
    ch = G();
  }
  while (ch >= '0' && ch <= '9')
    res = (res << 3) + (res << 1) + ch - 48, ch = G();
  return res * f;
}
inline double readB() {
  register double res = 0, f = 1, ff = 1;
  char ch = ' ';
  while ((ch < '0' || ch > '9') && ch != EOF) {
    if (ch == '-') f = -1;
    ch = G();
  }
  while (ch >= '0' && ch <= '9') res = res * 10 + (ch ^ 48), ch = G();
  if (ch == '.') {
    ch = G();
    while (ch >= '0' && ch <= '9')
      ff /= 10, res = res + (ch ^ 48) * ff, ch = G();
  }
  return res * f;
}
inline void wtL(long long a) {
  if (a > 9) wtL(a / 10);
  P(a % 10 + '0');
  return;
}
inline void writeL(long long a, char b) {
  if (a < 0) P('-'), a = -a;
  wtL(a), P(b);
}
inline void wt(int a) {
  if (a > 9) wt(a / 10);
  P(a % 10 + '0');
  return;
}
inline void write(int a, char b) {
  if (a < 0) P('-'), a = -a;
  wt(a), P(b);
}
inline int random(int a, int b) {
  return (rand() + 19) * (rand() + 97) % (b - a + 1) + a;
}
const int N = 1e6 + 10, base = 19260817, mod = 1e9 + 9;
int n, m, len, p[N], has[N], pw[N], has_val, cnt;
char s[N];
inline int get_has(int i, int len) {
  return (has[i + len - 1] - 1ll * has[i - 1] * pw[len] % mod + mod) % mod;
}
inline int ksm(int x, int p) {
  register int res = 1;
  for (; p; x = 1ll * x * x % 1000000007, p >>= 1)
    if (p & 1) res = 1ll * res * x % 1000000007;
  return res;
}
int main() {
  n = read(), m = read();
  pw[0] = 1;
  for (register int i = 1; i <= n; i++) pw[i] = 1ll * pw[i - 1] * base % mod;
  for (s[len = 1] = G(); s[len] < 'a' || s[len] > 'z'; s[len] = G())
    ;
  for (; s[len] >= 'a' && s[len] <= 'z'; s[++len] = G())
    ;
  len--;
  for (register int i = 1; i <= m; i++) p[i] = read();
  sort(p + 1, p + m + 1);
  p[m + 1] = n + 1;
  for (int i = 1; i <= m; i++)
    for (int j = p[i], mx = min(p[i] + len - 1, p[i + 1] - 1); j <= mx; j++)
      has[j] = (1ll * has[j - 1] * base + s[j - p[i] + 1]) % mod;
  for (int i = 1; i <= len; i++) has_val = (1ll * has_val * base + s[i]) % mod;
  for (int i = 1; i <= m; i++)
    if (get_has(p[i], len) != has_val) {
      puts("0");
      return 0;
    }
  for (int i = 1; i <= n; i++)
    if (has[i] == 0) cnt++;
  printf("%d\n", ksm(26, cnt));
  fwrite(PUF, 1, Pout - PUF, stdout);
  return 0;
}
