#include <bits/stdc++.h>
using namespace std;
inline void zFunc(const string &str, vector<int> &z) {
  int n = ((int)(str).size());
  z.resize(n, 0);
  int l = 0, r = 0;
  for (int i = 1; i < n; ++i) {
    if (z[i - l] < r - i + 1) {
      z[i] = z[i - l];
    } else {
      l = i;
      r = max(r, i);
      z[i] = r - i;
      while (r < n && str[r] == str[z[i]]) {
        ++r, ++z[i];
      }
      --r;
    }
  }
}
string str;
vector<int> z;
int seq[1000001];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL), cout.tie(NULL);
  int n, p;
  cin >> n >> p >> str;
  zFunc(str, z);
  bool good = true;
  for (int i = 0, j = 0; i < p; ++i) {
    cin >> seq[i];
    if (j && (seq[i] - j < ((int)(str).size())) &&
        z[seq[i] - j] < (((int)(str).size()) - (seq[i] - j))) {
      good = false;
    }
    j = seq[i];
  }
  if (good) {
    int ans = 1, covered = 0;
    for (int i = 1, j = 0; i <= n; ++i) {
      if (j < p && i == seq[j]) {
        covered = i + ((int)(str).size()) - 1;
        ++j;
      }
      if (i > covered) {
        ans = (ans * 26ll) % 1000000007;
      }
    }
    cout << ans << '\n';
  } else {
    cout << 0 << '\n';
  }
  return 0;
}
