#include <bits/stdc++.h>
using namespace std;
long long P = 15485849;
long long X = 15469351;
long long M = 1000000000 + 7;
const int size = 1000005;
char S[size];
int n, m, s;
long long H[size], Pot[size];
long long myhash(int i, int j) {
  return (((H[i] - Pot[j - i + 1] * H[j + 1]) % P) + P) % P;
}
int main() {
  scanf("%d %d", &n, &m);
  scanf("%s", S + 1);
  vector<int> Y;
  for (int i = 0; i < m; i++) {
    int x;
    scanf("%d", &x);
    Y.push_back(x);
  }
  s = strlen(S + 1);
  bool ok = true;
  if (Y.size() > 0 && Y[Y.size() - 1] + s - 1 > n) ok = false;
  H[s] = S[s];
  for (int i = s - 1; i >= 1; i--) H[i] = ((long long)S[i] + X * H[i + 1]) % P;
  Pot[0] = 1;
  for (int i = 1; i <= s; i++) Pot[i] = (Pot[i - 1] * X) % P;
  for (int i = 0; Y.size() > 0 && i < Y.size() - 1; i++) {
    int a = Y[i], b = Y[i] + s - 1, c = Y[i + 1], d = Y[i + 1] + s - 1;
    if (c > b) continue;
    int p = b - c + 1;
    if (myhash(1, p) != myhash(s - p + 1, s)) ok = false;
  }
  if (ok) {
    long long result = 1;
    for (int i = 1; i <= n; i++) {
      int w = lower_bound(Y.begin(), Y.end(), i) - Y.begin();
      if (w != Y.size() && Y[w] == i) continue;
      w--;
      if (w == -1 || Y[w] + s - 1 < i) result = (result * 26ll) % M;
    }
    cout << result << endl;
  } else
    cout << 0 << endl;
  return 0;
}
