#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
char P[2000010];
int b[2000010], len;
inline long long modexp(int a, int b, int c) {
  if (b == 0) return 1;
  if (b == 1) return a % c;
  long long temp = modexp(a, b / 2, c);
  temp = (temp * 1LL * temp) % c;
  if (b & 1) temp = (temp * 1LL * a) % c;
  return temp;
}
void kmpPreprocess() {
  int i = 0, j = -1;
  b[0] = -1;
  while (i < len) {
    while (j >= 0 && P[i] != P[j]) j = b[j];
    i++;
    j++;
    b[i] = j;
  }
}
int inp[2000010];
bool flag[2000010];
int main() {
  int n, m;
  scanf("%d", &n);
  scanf("%d", &m);
  scanf("%s", P);
  len = strlen(P);
  kmpPreprocess();
  memset(flag, 0, sizeof flag);
  flag[0] = true;
  int curr = len - 1;
  while (curr >= 0) {
    if (P[len - 1] == P[curr]) {
      flag[curr + 1] = true;
      if (0) printf("premissible %d\n", curr + 1);
    }
    curr = b[curr];
  }
  for (int i = 0; i < m; i++) scanf("%d", &inp[i]);
  int left = 0;
  for (int i = 0; i < m; i++) {
    if (i < (m - 1) &&
        ((inp[i + 1] - inp[i] <= len) && !flag[len - (inp[i + 1] - inp[i])])) {
      if (0)
        printf("len = %d, inp[i] = %d    , not flag %d\n", len, inp[i],
               len - (inp[i + 1] - inp[i]));
      printf("0\n");
      return 0;
    } else {
      if (i == 0)
        left = inp[i] - 1;
      else {
        int diff = inp[i] - (inp[i - 1] + len - 1) - 1;
        diff = max(diff, 0);
        left += diff;
      }
    }
  }
  if (m > 0)
    left += n - (inp[m - 1] + len - 1);
  else
    left = n;
  if (0) printf("left = %d\n", left);
  printf("%lld\n", modexp(26, left, MOD));
  return 0;
}
