#include <bits/stdc++.h>
int dx[] = {0, 1, -1, 0, 1, -1, 1, -1, -2, 2, 0, 0},
    dy[] = {1, 0, 0, -1, -1, 1, 1, -1, 0, 0, -2, 2};
using namespace std;
const long long M3 = 1e9 + 7;
long long modPow3[1000006];
bool valid[1000006];
vector<int> fail(string p) {
  vector<int> first;
  int l = 0;
  first.push_back(0);
  int i = 1;
  while (first.size() < p.size()) {
    if (p[i] == p[l]) {
      l++;
      first.push_back(l);
      i++;
    } else {
      if (l)
        l = first[l - 1];
      else {
        first.push_back(0);
        i++;
      }
    }
  }
  return first;
}
vector<int> dsu;
int su(int i) {
  if (dsu[i] == 1) return 1;
  if (dsu[i] == 0) return 0;
  dsu[i] = su(dsu[dsu[i] - 1]);
}
int main() {
  int n, m;
  cin >> n >> m;
  modPow3[0] = 1;
  string p;
  cin >> p;
  vector<int> first = fail(p);
  dsu = first;
  for (int i = 1; i < 1000006; i++) {
    modPow3[i] = (modPow3[i - 1] * 26) % M3;
  }
  for (int i = 0; i < first.size(); i++) {
    valid[i] = su(i);
  }
  long long rem = n;
  int prev = -1;
  for (int i = 0; i < m; i++) {
    int st;
    cin >> st;
    if (prev == -1) {
      rem -= p.size();
      prev = st;
    } else {
      if (st - prev < p.size()) {
        if (valid[st - prev])
          rem -= (st - prev);
        else {
          cout << "0";
          exit(0);
        }
      } else {
        rem -= p.size();
      }
      prev = st;
    }
  }
  cout << modPow3[rem];
}
