#include <bits/stdc++.h>
using namespace std;
const int MAXP = 1e6;
int n, m, lp;
char p[MAXP];
int y[MAXP];
int zfun[MAXP];
void prefix(const char *s) {
  int n = strlen(s), k = -1;
  zfun[0] = -1;
  for (int i = (1); i < (n); i++) {
    while (k != -1 && s[k + 1] != s[i]) k = zfun[k];
    if (s[k + 1] == s[i]) k++;
    zfun[i] = k;
  }
}
set<int> s;
int main() {
  scanf("%d %d %s", &n, &m, p);
  for (int i = (0); i < (m); i++) scanf("%d", y + i);
  lp = strlen(p);
  prefix(p);
  int k = zfun[lp - 1];
  while (k != -1) {
    s.insert(k + 1);
    k = zfun[k];
  }
  int last = -1;
  long long x = 0;
  bool ok = true;
  for (int i = (0); i < (m); i++) {
    if (y[i] <= last) {
      if (!s.count(last - y[i] + 1)) {
        ok = false;
        break;
      }
    } else
      x += y[i] - last - 1;
    last = y[i] + lp - 1;
  }
  x += n - 1 - last;
  long long ans = ok;
  for (int i = (0); i < (x); i++) ans = (ans * 26) % 1000000007;
  printf("%I64d\n", ans);
  return 0;
}
