#include <bits/stdc++.h>
using namespace std;
int nxt[1000010], len2, a[1000010];
char b[1000010];
bool used[1000010], flag[1000010];
void init() {
  int t;
  nxt[1] = 0;
  t = 0;
  for (int i = 2; i <= len2; i++) {
    while ((b[i] != b[t + 1]) && t > 0) t = nxt[t];
    if (b[i] == b[t + 1]) t++;
    nxt[i] = t;
  }
}
int main() {
  int n, m, pre, now;
  long long ans = 1;
  scanf("%d%d", &n, &m);
  scanf("%s", b + 1);
  len2 = strlen(b + 1);
  init();
  now = len2;
  while (now) {
    flag[now] = true;
    now = nxt[now];
  }
  for (int i = 1; i <= m; i++) scanf("%d", &a[i]);
  for (int i = 1; i < m; i++) {
    pre = a[i];
    now = a[i + 1];
    if (now - pre < len2) {
      if (!flag[len2 + pre - now]) {
        printf("0\n");
        return 0;
      }
    }
  }
  int sb = 0;
  for (int i = 1; i <= m; i++) {
    if (!used[a[i] + len2 - 1]) {
      for (int j = max(a[i], sb + 1); j - a[i] + 1 <= len2 && j <= n; j++) {
        used[j] = true;
      }
      sb = a[i] + len2 - 1;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (!used[i]) {
      ans *= 26;
      ans %= 1000000007;
    }
  }
  printf("%I64d\n", ans);
  return 0;
}
