#include <bits/stdc++.h>
using namespace std;
char s[3000005];
int fail[3000005], num[3000005], p[3000005];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  scanf("%s", s + 1);
  int l = strlen(s + 1);
  for (int i = 1, j = 0; i <= l; i++) {
    while (j && s[j + 1] != s[i]) j = fail[j];
    if (i != 1 && s[j + 1] == s[i]) j++;
    fail[i] = j;
  }
  for (int i = fail[l]; i; i = fail[i]) num[l - i] = 1;
  for (int i = 1; i <= m; i++) scanf("%d", &p[i]);
  for (int i = 1; i <= m; i++) p[i] += l - 1;
  for (int i = 2; i <= m; i++)
    if (p[i] - p[i - 1] < l) {
      int val = p[i] - p[i - 1];
      if (!num[val]) {
        printf("0\n");
        return 0;
      }
    }
  int cnt = 0;
  for (int i = 1; i <= m; i++) cnt += min(p[i] - p[i - 1], l);
  cnt = n - cnt;
  int Ans = 1;
  for (int i = 1; i <= cnt; i++) Ans = Ans * 26LL % 1000000007;
  printf("%d\n", Ans);
}
