#include <bits/stdc++.h>
using namespace std;
const int mod = (int)1e9 + 7;
char s[1000100];
int z[1000100];
int m, n, len;
int a[1000100];
void init(void) {
  scanf("%d%d", &n, &m);
  scanf("%s", s);
  len = strlen(s);
  for (int i = (1), _b = (m); i <= _b; i = i + 1) scanf("%d", &a[i]);
  sort(a + 1, a + m + 1);
}
void ZAlgorithm(void) {
  int L = 0;
  int R = 0;
  for (int i = (1), _b = (len - 1); i <= _b; i = i + 1) {
    if (i > R) {
      L = R = i;
      while (R < len && s[R - L] == s[R]) R++;
      z[i] = R - L;
      R--;
    } else {
      int k = i - L;
      if (z[k] < R - i + 1)
        z[i] = z[k];
      else {
        L = i;
        while (R < len && s[R - L] == s[R]) R++;
        z[i] = R - L;
        R--;
      }
    }
  }
  z[0] = len;
}
bool preSuf(int i) { return (z[len - i] >= i); }
void process(void) {
  for (int i = (2), _b = (m); i <= _b; i = i + 1) {
    int cur = a[i];
    int prev = a[i - 1];
    if (prev + len - 1 < cur) continue;
    if (!preSuf(len - cur + prev)) {
      printf("0\n");
      return;
    }
  }
  int res = 1;
  for (int i = (1), _b = (n); i <= _b; i = i + 1) {
    int id = upper_bound(a + 1, a + m + 1, i) - a - 1;
    if (id < 1 || a[id] + len - 1 < i) res = 26LL * res % mod;
  }
  printf("%d\n", res);
}
int main(void) {
  init();
  ZAlgorithm();
  process();
  return 0;
}
