#include <bits/stdc++.h>
using namespace std;
const int sigma_size = 26;
const int N = 100 + 50;
const int MAXN = 1000000 + 50;
const int inf = 0x3fffffff;
const double eps = 1e-8;
const int HASH = 100007;
const int mod = 1000000000 + 7;
int n, m, len;
char str[MAXN];
int fail[MAXN];
void get_fail() {
  int i = 0, j = -1;
  fail[0] = -1;
  while (i < len) {
    if (j == -1 || str[i] == str[j]) {
      i++;
      j++;
      fail[i] = j;
    } else
      j = fail[j];
  }
}
long long num_pow(long long a, long long k) {
  long long ans = 1;
  while (k) {
    if (k & 1) ans = (ans * a) % mod;
    a = (a * a) % mod;
    k >>= 1;
  }
  return ans;
}
int main() {
  while (~scanf("%d%d", &n, &m)) {
    scanf("%s", str);
    len = strlen(str);
    get_fail();
    int last = -1, ok = 1, num = 0, pre;
    for (int i = 0; i < m; i++) {
      int now;
      scanf("%d", &now);
      now--;
      num += max(0, now - last - 1);
      int l = pre + len - now;
      pre = now;
      if (i == 0) {
        last = now + len - 1;
        continue;
      }
      last = now + len - 1;
      if (l < 0) continue;
      int cur = len;
      while (fail[cur] != -1) {
        if (fail[cur] == l) break;
        cur = fail[cur];
      }
      if (fail[cur] == -1) {
        ok = 0;
      }
    }
    num += n - last - 1;
    if (!ok) {
      printf("0\n");
      continue;
    } else
      printf("%lld\n", num_pow(26, num));
  }
  return 0;
}
