#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 20;
const int MOD = 1e9 + 7;
char sub[maxn];
int tonext[maxn];
int pos[maxn];
bool book[maxn];
void get_next(char sub[], int lensub) {
  int i = 1, j = 0;
  tonext[1] = 0;
  while (i <= lensub) {
    if (j == 0 || sub[i] == sub[j]) {
      tonext[++i] = ++j;
    } else
      j = tonext[j];
  }
  return;
}
void work() {
  int lenstr, m;
  scanf("%d%d", &lenstr, &m);
  scanf("%s", sub + 1);
  int lensub = strlen(sub + 1);
  get_next(sub, lensub);
  for (int i = 1; i <= m; ++i) {
    scanf("%d", &pos[i]);
  }
  int t = tonext[lensub + 1];
  while (t != 1) {
    book[t - 1] = true;
    t = tonext[t];
  }
  int total = lenstr - lensub;
  if (m == 0) {
    total += lensub;
  }
  for (int i = 2; i <= m; ++i) {
    int to = pos[i - 1] + lensub - 1;
    int haha = to - pos[i] + 1;
    if (haha <= 0) {
      total -= lensub;
      continue;
    }
    if (!book[haha]) {
      printf("0\n");
      return;
    }
    total -= lensub - haha;
  }
  long long int ans = 1;
  for (int i = 1; i <= total; ++i) {
    ans *= 26;
    if (ans >= MOD) ans %= MOD;
  }
  printf("%I64d\n", ans);
}
int main() {
  work();
  return 0;
}
