#include <bits/stdc++.h>
inline unsigned int getuint() {
  char w = getchar();
  while (w < '0' || '9' < w) w = getchar();
  unsigned int ans = 0;
  for (; '0' <= w && w <= '9'; w = getchar()) ans = ans * 10 + w - '0';
  return ans;
}
const int mod = 1000000007;
char str[1000005];
int next[1000005], ok[1000005];
int a[1000005];
int main() {
  int N = getuint(), m = getuint();
  scanf("%s", str + 1);
  int n = strlen(str + 1);
  for (int i = 1, j = next[i - 1] = -1; i <= n; next[i++] = ++j)
    for (; ~j && str[j + 1] != str[i]; j = next[j])
      ;
  for (int i = n; i; i = next[i]) ok[i] = 1;
  long long ans = 1;
  for (int i = 1; i <= m; i++) a[i] = getuint();
  int last = 0;
  for (int i = 1; i <= m; i++) {
    if (last < a[i])
      for (int j = last + 1; j < a[i]; j++) ans = ans * 26 % mod;
    else if (!ok[last - a[i] + 1])
      return puts("0"), 0;
    last = a[i] + n - 1;
  }
  for (int i = last + 1; i <= N; i++) ans = ans * 26 % mod;
  printf("%I64d\n", ans);
  return 0;
}
