#include <bits/stdc++.h>
using namespace std;
int n, m, first[2000020], a[2000020], c, ans, mod = 1e9 + 7;
char s[2000020];
string p, k;
int getNextLen(int len, char c) {
  while (len && k[len] != c) len = first[len - 1];
  if (k[len] == c) ++len;
  return len;
}
void computeF() {
  first[0] = 0;
  for (int i = 1; i < k.size(); ++i) first[i] = getNextLen(first[i - 1], k[i]);
}
int main() {
  cin >> n >> m;
  cin >> p;
  for (int i = 1; i <= m; i++) {
    cin >> a[i];
    for (int j = max(c + 1, a[i]), t = max(c - a[i] + 1, 0);
         j < min(a[i] + (int)p.size(), n + 1); j++, t++)
      s[j] = p[t];
    c = a[i] + p.size() - 1;
  }
  k = p + '#';
  for (int i = 1; i <= n; i++) {
    if (!s[i])
      k.push_back('?');
    else
      k.push_back(s[i]);
  }
  computeF();
  ans = max(0, a[1] - 1);
  for (int i = 1; i <= m; i++) {
    if (first[a[i] + p.size() * 2 - 1] != p.size()) {
      cout << "0";
      return 0;
    }
    if (i > 1) ans += max(0, a[i] - a[i - 1] - (int)p.size());
  }
  ans += max(0, n - a[m] - (int)p.size() + 1);
  if (m == 0) ans = n;
  long long ff = 1;
  for (int i = 1; i <= ans; i++) {
    ff *= (long long)26;
    ff %= mod;
  }
  cout << ff;
  return 0;
}
