#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 100;
const int mod = 1000000007;
int nxt[N];
bool ok[N];
void kmp_pre(char x[], int m, int nxt[]) {
  int i, j;
  j = nxt[0] = -1;
  i = 0;
  while (i < m) {
    while (-1 != j && x[i] != x[j]) j = nxt[j];
    nxt[++i] = ++j;
  }
}
char s[N];
int vis[N];
bool ed[2 * N];
int main() {
  int n, m;
  cin >> n >> m;
  scanf("%s", s);
  int l = strlen(s);
  kmp_pre(s, l, nxt);
  int i = l;
  while (i != -1) ok[nxt[i]] = 1, i = nxt[i];
  for (i = 1; i <= m; i++) {
    int p;
    scanf("%d", &p);
    vis[--p] = 1;
    ed[p + l - 1] = 1;
  }
  bool flag = 0;
  int sta = 0;
  int last;
  for (int i = 0; i < n && flag == 0; i++) {
    if (vis[i]) {
      if (sta) {
        if (ok[last + l - i] == 0) flag = 1;
      }
      sta++;
      last = i;
    }
    if (ed[i]) sta--;
  }
  if (flag)
    puts("0");
  else {
    int cnt = 0;
    int st = 0;
    for (int i = 0; i < n; i++) {
      if (vis[i]) st++;
      if (st == 0) cnt++;
      if (ed[i]) st--;
    }
    long long ans = 1;
    while (cnt--) {
      ans = (ans * 26) % mod;
    }
    cout << ans << endl;
  }
}
