#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 10000;
const int MOD = 1e9 + 7;
int n, m;
int a[maxn];
int Next[maxn];
char s[maxn];
bool vis[maxn];
bool vis1[maxn];
int len;
long long mod_pow(long long x, long long n) {
  long long res = 1;
  while (n) {
    if (n % 2 == 1) res = res * x % MOD;
    x = x * x % MOD;
    n /= 2;
  }
  return res;
}
void getnext() {
  memset(vis, false, sizeof(vis));
  memset(vis1, false, sizeof(vis1));
  int i = 0, j = -1;
  Next[0] = -1;
  len = strlen(s);
  while (i < len) {
    if (j == -1 || s[i] == s[j])
      i++, j++, Next[i] = j;
    else
      j = Next[j];
  }
  int r = len;
  while (r != -1) {
    vis1[r] = true;
    r = Next[r];
  }
  return;
}
int main(void) {
  cin >> n >> m;
  scanf("%s", s);
  for (int i = 1; i <= m; i++) scanf("%d", &a[i]);
  getnext();
  sort(a + 1, a + 1 + m);
  for (int i = 1; i <= m; i++) {
    if (i == 1 || a[i] - a[i - 1] >= len) {
      for (int j = a[i]; j <= a[i] + len - 1; j++) vis[j] = true;
    } else {
      if (vis1[a[i - 1] + len - a[i]]) {
        for (int j = a[i - 1] + len; j <= a[i] + len - 1; j++) vis[j] = true;
      } else {
        printf("0\n");
        return 0;
      }
    }
  }
  long long ans = 1;
  long long cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (vis[i] == false) {
      cnt++;
    }
  }
  ans = mod_pow(1LL * 26, cnt);
  cout << ans << endl;
}
