#include <bits/stdc++.h>
using namespace std;
const int MAX = 1000100;
const int mod = int(1e9) + 7;
int L, K, N;
char s[MAX];
int fn[MAX];
bool good[MAX];
bool bio[MAX];
void kmp() {
  for (int t = (1); t < (N); ++t) {
    int x = t + 1;
    fn[x] = fn[t];
    while (fn[x] && s[fn[x]] != s[t]) fn[x] = fn[fn[x]];
    if (s[fn[x]] == s[t]) ++fn[x];
  }
}
void mark(int lo, int hi) {
  for (int i = (lo); i < (hi); ++i) bio[i] = true;
}
int main() {
  scanf("%d%d", &L, &K);
  scanf("%s", s);
  N = strlen(s);
  kmp();
  for (int x = N; x; x = fn[x]) good[x] = true;
  bool ok = true;
  int last = -1e9;
  for (int i = (0); i < (K); ++i) {
    int x;
    scanf("%d", &x);
    --x;
    if (last + N > x) {
      ok &= good[last + N - x];
      mark(last + N, x + N);
    } else {
      mark(x, x + N);
    }
    last = x;
  }
  if (!ok) {
    puts("0");
    return 0;
  }
  long long ans = ok;
  for (int i = (0); i < (L); ++i)
    if (!bio[i]) ans = ans * 26 % mod;
  cout << ans << endl;
  return 0;
}
