#include <bits/stdc++.h>
using namespace std;
void calc(vector<bool> &preproc, const string &p) {
  int i = 1, longest = 0;
  vector<int> aux(preproc.size(), 0);
  while (i < p.size()) {
    if (p[i] == p[longest]) {
      longest++;
      aux[i] = longest;
      i++;
    } else if (longest > 0) {
      longest = aux[longest - 1];
    } else {
      aux[i] = 0;
      i++;
    }
  }
  int n = aux.size() - 1;
  while (n >= 0) {
    preproc[n] = true;
    n = aux[n] - 1;
  }
}
int main() {
  int n, m, aux;
  cin >> n >> m;
  string p;
  cin >> p;
  vector<int> subs;
  for (int i = 0; i < m; i++) {
    cin >> aux;
    subs.push_back(aux);
  }
  vector<bool> preproc(p.size(), false);
  calc(preproc, p);
  vector<int> seq(n, -1);
  for (int i = 0; i < m; i++) {
    if (i + 1 < m && subs[i + 1] < subs[i] + p.size()) {
      if (!preproc[preproc.size() + subs[i] - (subs[i + 1] + 1)]) {
        cout << 0 << endl;
        return 0;
      }
    }
  }
  int exp = 0, curr = 1;
  for (int i = 0; i < m; i++) {
    if (curr < subs[i]) {
      exp += subs[i] - curr;
    }
    curr = subs[i] + p.size();
  }
  exp += n + 1 - curr;
  unsigned long long ret = 1;
  for (int i = 0; i < exp; i++) {
    ret *= 26;
    ret %= 1000000007;
  }
  cout << ret << endl;
  return 0;
}
