#include <bits/stdc++.h>
using namespace std;
const int kMaxLenS = 1000005;
long long kNext[kMaxLenS];
bool kHash[kMaxLenS];
long long len_p, len_s, sum_sub;
char p[kMaxLenS];
void getNext() {
  kNext[1] = 0;
  long long k = 0;
  for (long long q = 2; q <= len_p; q++) {
    while (k > 0 && p[k] != p[q - 1]) k = kNext[k];
    if (p[k] == p[q - 1]) k++;
    kNext[q] = k;
  }
}
int main() {
  scanf("%I64d%I64d", &len_s, &sum_sub);
  scanf("%s", p);
  len_p = strlen(p);
  getNext();
  for (long long i = kNext[len_p]; i; i = kNext[i]) kHash[i] = 1;
  kHash[len_p] = 1;
  long long x, y;
  if (sum_sub) {
    scanf("%I64d", &x);
    len_s -= len_p;
  }
  for (int i = 2; i <= sum_sub; i++) {
    scanf("%I64d", &y);
    if (y - x >= len_p)
      len_s -= len_p;
    else {
      if (!kHash[x + len_p - y]) {
        cout << 0 << endl;
        return 0;
      }
      len_s -= (y - x);
    }
    x = y;
  }
  long long sum = 1;
  for (long long i = 0; i < len_s; i++) {
    sum = (sum * 26) % 1000000007;
  }
  cout << sum << endl;
  return 0;
}
