#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000100;
const int mod = 1e9 + 7;
char s[MAXN];
int z[MAXN];
int f[MAXN];
void calculateZ(char *s, int n) {
  z[0] = n;
  int L = 0, R = 0;
  for (int i = (1); i < (n); ++i) {
    if (i > R)
      L = i, R = i - 1, z[i] = 0;
    else if (z[i - L] < R - i + 1)
      z[i] = z[i - L];
    else
      z[i] = R - i + 1, L = i;
    while (R + 1 < n && s[i + z[i]] == s[z[i]]) R++, z[i]++;
  }
}
int main(void) {
  int n, m;
  scanf("%d %d", &n, &m);
  scanf("%s", s);
  int p = strlen(s);
  calculateZ(s, p);
  int last = -1;
  for (int i = (0); i < (m); ++i) {
    int x;
    scanf("%d", &x);
    --x;
    f[x]++, f[x + p]--;
    if (last != -1 && last + p > x)
      if (z[x - last] < p - (x - last)) {
        printf("0\n");
        return 0;
      }
    last = x;
  }
  int ans = 1;
  int cur = 0;
  for (int i = (0); i < (n); ++i) {
    cur += f[i];
    if (cur == 0) ans = (ans * 26LL) % mod;
  }
  printf("%d\n", ans);
  return 0;
}
