#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 5, mod = 1e9 + 7;
long long pow_mod(long long a, long long b);
char p[maxn];
int pos[maxn], Next[maxn], mark[maxn];
int main() {
  int n, m, len;
  scanf("%d %d %s", &n, &m, p + 1);
  len = strlen(p + 1);
  for (int i = 2, j = 0; i <= len; i++) {
    while (j > 0 && p[i] != p[j + 1]) j = Next[j];
    if (p[i] == p[j + 1]) j++;
    Next[i] = j;
  }
  for (int i = len; i; i = Next[i]) mark[i] = 1;
  scanf("%d", &pos[1]);
  for (int i = 2; i <= m; i++) {
    scanf("%d", &pos[i]);
    if (pos[i] - pos[i - 1] >= len) continue;
    if (pos[i] + len - 1 > n || mark[len - (pos[i] - pos[i - 1])] == 0) {
      printf("0");
      return 0;
    }
  }
  if (m) n -= len;
  for (int i = 2; i <= m; i++)
    n -= pos[i] - pos[i - 1] < len ? pos[i] - pos[i - 1] : len;
  printf("%lld", pow_mod((long long)26, (long long)n));
  return 0;
}
long long pow_mod(long long a, long long b) {
  a %= mod;
  if (a == 0) return 0;
  long long ans = 1;
  while (b) {
    if (b & 1) ans = (ans * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return ans % mod;
}
