#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long infinity = 1000000000000000000;
const int inf = 1e9 + 5;
bool do_debug = false;
void z_algorithm(vector<int>& z, string s, int len) {
  int l = 0, r = 0;
  for (int i = 1; i < len; i++) {
    if (i <= r) {
      z[i] = min(r - i + 1, z[i - l]);
    }
    while (i + z[i] < len && s[z[i]] == s[i + z[i]]) {
      z[i]++;
    }
    if (z[i] + i - 1 > r) {
      l = i;
      r = z[i] + i - 1;
    }
  }
}
long long binary_exponentiation_modulo(long long n, long long M) {
  long long retval = 1;
  long long m = mod;
  while (M > 0) {
    if (M & 1) {
      retval = ((retval % m) * (n % m)) % m;
    }
    M = M >> 1;
    n = ((n % m) * (n % m)) % m;
  }
  return retval % m;
}
void solve() {
  int oglen, nseq;
  string fav;
  int len;
  vector<int> seq;
  cin >> oglen >> nseq;
  seq.reserve(nseq);
  cin >> fav;
  len = fav.length();
  for (int i = 0; i < nseq; i++) {
    int e;
    cin >> e;
    e--;
    seq.push_back(e);
  }
  vector<int> z(len);
  z_algorithm(z, fav, len);
  long long cnt = 0;
  int cur = -1;
  for (int e : seq) {
    if (e <= cur) {
      int rel = len - 1 - (cur - e);
      if (z[rel] >= cur - e + 1) {
        cur = e + len - 1;
      } else {
        cout << 0 << "\n";
        return;
      }
      if (cur >= oglen) {
        cout << 0 << "\n";
        return;
      }
    } else {
      cnt += e - cur - 1;
      cur = e + len - 1;
      if (cur >= oglen) {
        cout << 0 << "\n";
        return;
      }
    }
  }
  if (cur < oglen) {
    cnt += oglen - 1 - cur;
  }
  cout << binary_exponentiation_modulo(26LL, cnt) << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int q = 1;
  while (q-- > 0) {
    solve();
  }
  return 0;
}
