#include <bits/stdc++.h>
using namespace std;
long long int powmod(long long int a, long long int b) {
  if (b == 0) return 1;
  long long int x = powmod(a, b / 2);
  long long int y = (x * x) % 1000000007;
  if (b % 2) return (a * y) % 1000000007;
  return y % 1000000007;
}
char patt[1000010], a[1000010];
int f[1000010];
int l, k;
int n;
map<int, int> M;
int x[1000010];
void failurefunc() {
  f[0] = f[1] = 0;
  int j;
  for (int i = 2; i < k + 1; i++) {
    j = f[i - 1];
    for (;;) {
      if (patt[j] == patt[i - 1]) {
        f[i] = j + 1;
        break;
      }
      if (j == 0) {
        f[i] = 0;
        break;
      }
      j = f[j];
    }
  }
}
int main() {
  int m;
  scanf("%d", &n);
  scanf("%d", &m);
  scanf("%s", patt);
  k = strlen(patt);
  l--;
  failurefunc();
  for (int i = 0; i < m; i++) {
    scanf("%d", &x[i]);
    x[i]--;
  }
  int ind = 0, pattind = -1;
  for (int i = 0; i < n; i++) a[i] = '.';
  if (m == 0) {
    printf("%lld\n", powmod(26LL, (long long int)n));
    return 0;
  }
  for (int i = 0; i < n; i++) {
    if (i == x[ind]) {
      pattind = 0;
      ind++;
    }
    if (pattind == -1) continue;
    a[i] = patt[pattind++];
    if (pattind == k) pattind = -1;
  }
  a[n] = '\0';
  int i = 0;
  l = n;
  vector<int> v;
  for (int j = 0; j <= l - 1; j++) {
    while (1) {
      if (a[j] == patt[i]) {
        i++;
        if (i == k) {
          i = f[k];
          v.push_back(j - k + 1);
        }
        break;
      } else if (i > 0)
        i = f[i];
      else
        break;
    }
  }
  if ((int)(v.size()) < m) {
    printf("0\n");
    return 0;
  }
  int j = 0;
  for (int i = 0; i < m; i++) {
    while (j != (int)(v.size()) && x[i] > v[j]) j++;
    if (j == (int)(v.size()) || x[i] != v[j]) {
      printf("0\n");
      return 0;
    }
  }
  long long int cnt = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] == '.') cnt++;
  }
  printf("%lld\n", powmod(26LL, cnt));
  return 0;
}
