#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 1, M = 1e9 + 7;
int n, m, F[N], a[N];
char p[N], s[N];
bool vis[N];
int main(int argc, char **argv) {
  scanf("%d%d%s", &n, &m, p);
  for (int i = 0; i < m; ++i) {
    scanf("%d", &a[i]);
    --a[i];
  }
  int len = strlen(p);
  for (int i = 1, k = 0; i < len; ++i) {
    while (k != 0 && p[k] != p[i]) k = F[k - 1];
    if (p[k] == p[i]) ++k;
    F[i] = k;
  }
  int at = len;
  while (at != 0) {
    vis[at] = true;
    at = F[at - 1];
  }
  fill(s, s + n, 'A');
  bool ok = true;
  for (int i = 0; i < m; ++i) {
    int str = 0;
    if (i != 0 && a[i - 1] + len > a[i]) {
      str = a[i - 1] + len - a[i];
      if (!vis[str]) {
        ok = false;
        break;
      }
    }
    for (int j = str; j < len; ++j) s[a[i] + j] = p[j];
  }
  if (!ok) {
    puts("0");
    return 0;
  }
  int res = 1;
  for (int i = 0; i < n; ++i)
    if (s[i] == 'A') res = (res * 26LL) % M;
  printf("%d\n", res);
  return 0;
}
