#include <bits/stdc++.h>
using namespace std;
const int N = 2e6;
int pi[N + 100], vis[N], x[N];
char p[N];
const long long mod = 1e9 + 7;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  scanf("%s", p);
  for (int i = 1; i <= m; i++) {
    scanf("%d", x + i);
    x[i]--;
  }
  string str = p;
  str += "#";
  string add = "";
  for (int i = 0; i < n; i++) {
    add += "?";
  }
  int ps = strlen(p);
  for (int i = 1; i <= m; i++) {
    int cur = x[i] + ps - 1;
    for (int j = ps - 1, k = cur; j >= 0 && !vis[k]; j--, k--) {
      add[k] = p[j];
      vis[k] = 1;
    }
  }
  str += add;
  for (int sz = str.size(), i = 1; i < sz; i++) {
    int j = pi[i - 1];
    while (j && str[i] != str[j]) {
      j = pi[j - 1];
    }
    if (str[i] == str[j]) {
      j++;
    }
    pi[i] = j;
  }
  bool flag = true;
  for (int i = 1; i <= m; i++) {
    if (pi[ps + x[i] + ps] != ps) {
      flag = false;
    }
  }
  if (!flag) {
    printf("0\n");
    return 0;
  }
  long long ans = 1;
  for (auto it : str) {
    if (it == '?') {
      ans = (ans * 26) % mod;
    }
  }
  printf("%lld\n", ans);
}
