#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 int B = 47, M = INT_MAX;
const int B2 = 29, M2 = 13773;
const long long M3 = 1e9 + 7;
int pref[1000006], suff[1000006];
int pref2[1000006], suff2[1000006];
int modPow[1000006];
int modPow2[1000006];
long long modPow3[1000006];
bool valid[1000006];
int main() {
  int n, m;
  cin >> n >> m;
  modPow[0] = modPow3[0] = modPow2[0] = 1;
  string p;
  cin >> p;
  for (int i = 1; i < 1000006; i++) {
    modPow[i] = (modPow[i - 1] * B) % M;
    modPow2[i] = (modPow2[i - 1] * B2) % M2;
    modPow3[i] = (modPow3[i - 1] * 26) % M3;
  }
  pref[0] = p[0];
  pref2[0] = p[0];
  suff[p.size() - 1] = p[p.size() - 1];
  suff2[p.size() - 1] = p[p.size() - 1];
  for (int i = 1; i < p.size(); i++)
    pref[i] = ((pref[i - 1] * B) % M + p[i]) % M,
    pref2[i] = ((pref2[i - 1] * B2) % M2 + p[i]) % M2;
  for (int i = p.size() - 2; i >= 0; i--)
    suff[i] = (suff[i + 1] + p[i] * modPow[p.size() - i - 1] % M) % M,
    suff2[i] = (suff2[i + 1] + p[i] * modPow2[p.size() - i - 1] % M2) % M2;
  for (int i = p.size() - 1; i >= 0; i--) {
    if (suff[i] == pref[p.size() - 1 - i] &&
        suff2[i] == pref2[p.size() - 1 - i]) {
      valid[i] = 1;
    }
  }
  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];
}
