#include <bits/stdc++.h>
using namespace std;
int f[2000005];
int p[2000005];
bool hit[2000005];
char s[2000005];
int ans(int p) {
  long long base = 26LL;
  long long retu = 1LL;
  while (p) {
    if (p & 1) {
      retu *= base;
      retu %= 1000000007LL;
    }
    base *= base;
    base %= 1000000007LL;
    p >>= 1;
  }
  return retu;
}
int main() {
  int t_length, occur;
  scanf("%d%d", &t_length, &occur);
  scanf("%s", &s);
  int j = f[0] = 0;
  int s_length = strlen(s);
  for (int i = 1; i < s_length; i++) {
    if (j > 0 && s[i] != s[j]) j = f[j - 1];
    if (s[i] == s[j]) ++j;
    f[i] = j;
  }
  int s_divider = s_length - f[s_length - 1];
  for (int i = 1; i < s_length; i++) {
    if (j > 0 && s[i] != s[j]) j = f[j - 1];
    if (s[i] == s[j]) ++j;
    f[i] = j;
    p[i + 1] = p[i];
    if (j == s_divider) {
      p[i + 1] += s_divider;
      j = f[j - 1];
    }
  }
  int cur, prev, index;
  if (occur) {
    scanf("%d", &cur);
    for (index = cur; index < cur + s_length; index++) {
      hit[index] = true;
    }
  }
  for (int i = 1; i < occur; i++) {
    prev = cur;
    scanf("%d", &cur);
    int length_of_intersection = (prev + s_length) - (cur);
    for (; index < cur; index++) {
    }
    for (; index < cur + s_length; index++) {
      hit[index] = true;
    }
    if (length_of_intersection <= 0) {
      continue;
    }
    int intersection_floor = length_of_intersection - f[s_length - 1];
    int current_index = length_of_intersection - 1;
    if (intersection_floor > p[current_index] ||
        intersection_floor % s_divider != 0) {
      printf("0");
      exit(0);
    }
  }
  int cnt = 0;
  for (int i = 1; i <= t_length; i++) {
    if (!hit[i]) cnt++;
  }
  printf("%d", ans(cnt));
}
