#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int MAXN = 1000006;
char s[MAXN];
int qp(long long a, int b) {
  long long ans = 1;
  while (b) {
    if (b % 2) ans = ans * a % mod;
    b /= 2;
    a = a * a % mod;
  }
  return ans;
}
void solve() {
  int n, k;
  scanf("%d%d", &n, &k);
  scanf("%s", s);
  string P(s);
  P = "#" + P;
  int pi[MAXN], m = P.size() - 1, q = 0;
  pi[0] = pi[1] = 0;
  for (int i = 2; i <= m; ++i) {
    while (q && P[i] != P[q + 1]) q = pi[q];
    if (P[i] == P[q + 1]) ++q;
    pi[i] = q;
  }
  int ile = 0;
  int prev = -m + 1;
  bool ok = true;
  set<int> S;
  int i = m;
  while (i) {
    S.insert(pi[i]);
    i = pi[i];
  }
  for (int i = 0; i < (k); ++i) {
    int a;
    scanf("%d", &a);
    ile += max(0, a - (prev + m));
    if (a - prev < m && prev > 0 && S.find(m - a + prev) == S.end()) ok = false;
    prev = a;
  }
  ile += max(0, n - (prev + m) + 1);
  if (!ok)
    printf("0\n");
  else
    printf("%d\n", qp(26, ile));
}
int main() {
  int t = 1;
  for (int i = 0; i < (t); ++i) solve();
  return 0;
}
