#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
vector<int> kmp(string& P) {
  int m = P.size();
  vector<int> B(int(P.size()) + 1, -1);
  B[0] = -1;
  int i = 0, j = -1;
  while (i < m) {
    while (j >= 0 and P[i] != P[j]) j = B[j];
    ++i, ++j;
    B[i] = j;
  }
  return B;
}
vector<int> sol(string& T, string& P, vector<int>& B) {
  int n = T.size(), m = P.size();
  int i = 0, j = 0;
  vector<int> ret;
  while (i < n) {
    while (j >= 0 and T[i] != P[j]) j = B[j];
    ++i, ++j;
    if (j == m) {
      ret.push_back(i - m);
      j = B[j];
    }
  }
  return ret;
}
void die() {
  cout << 0 << endl;
  exit(0);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  string p;
  cin >> p;
  vector<int> v(m);
  queue<int> Q;
  for (int i = 0; i < m; ++i) {
    cin >> v[i];
    --v[i];
    Q.push(v[i]);
  }
  string s(n, '#');
  while (!Q.empty()) {
    int v = Q.front();
    Q.pop();
    int nxt = Q.empty() ? v + int(p.size()) : min(v + int(p.size()), Q.front());
    for (int i = v; i < nxt; ++i) s[i] = p[i - v];
  }
  cerr << s << endl;
  vector<int> prefixtable = kmp(p);
  auto vans = sol(s, p, prefixtable);
  set<int> S;
  for (int x : v) S.insert(x);
  for (int x : vans) {
    if (S.count(x)) S.erase(x);
  }
  if (!S.empty()) die();
  int cur = 0;
  long long int ans = 1ll;
  while (cur < n) {
    if (s[cur] == '#') {
      ans = (ans * 26ll) % mod;
    }
    ++cur;
  }
  cout << ans << endl;
}
