#include <bits/stdc++.h>
using namespace std;
const int BASE = 1e9 + 7;
const int N = 1e6 + 10;
const int B = 1e6 + 7;
int n, m, SSize;
int a[N];
long long pw[N], H[N], Pow[N];
char S[N];
void InitHash() {
  SSize = strlen(S + 1);
  for (int i = 1; i <= SSize; ++i)
    H[i] = (H[i - 1] * B + (S[i] - 'a' + 1)) % BASE;
  pw[0] = 1;
  for (int i = 1; i <= SSize; ++i) pw[i] = pw[i - 1] * B % BASE;
}
long long Hash(int l, int r) {
  return (H[r] - H[l - 1] * pw[r - l + 1] + (long long)BASE * BASE) % BASE;
}
bool Check(int i, int j) {}
int main() {
  scanf("%d%d", &n, &m);
  scanf("%s", S + 1);
  for (int i = 1; i <= m; ++i) scanf("%d", &a[i]);
  InitHash();
  Pow[0] = 1;
  for (int i = 1; i <= n; ++i) Pow[i] = Pow[i - 1] * 26 % BASE;
  if (m == 0)
    printf("%d", Pow[n]);
  else {
    long long ans = Pow[a[1] - 1];
    for (int i = 1; i <= m - 1; ++i) {
      int l = a[i], r = a[i] + SSize - 1;
      int x = a[i + 1], y = a[i + 1] - SSize + 1;
      ans = ans * Pow[max(0, x - r - 1)] % BASE;
      int Length = r - x + 1;
      if (Length >= 1 &&
          Hash(SSize - Length + 1, SSize) != Hash(1, 1 + Length - 1)) {
        puts("0");
        return 0;
      }
    }
    printf("%I64d", ans * Pow[n - (a[m] + SSize - 1)] % BASE);
  }
  return 0;
}
