#include <bits/stdc++.h>
using namespace std;
const int maxM = 1e6 + 5, maxQ = 1e6 + 5, mod = 1e9 + 7, maxN = 1e6 + 5;
bool is_match[maxN];
int n, m, y[maxM], q, lps[maxN];
string p, s;
void compute_lps() {
  lps[0] = 0;
  for (int i = 1; i < q; i++) {
    lps[i] = lps[i - 1];
    while (lps[i] > 0 && p[lps[i]] != p[i]) {
      lps[i] = lps[lps[i] - 1];
    }
    if (p[lps[i]] == p[i]) {
      lps[i]++;
    }
  }
}
void kmp() {
  int start = 0, match = 0;
  while (start + q <= n) {
    while (match < q && p[match] == s[start + match]) {
      match++;
    }
    if (match == q) {
      is_match[start] = true;
    }
    match = max(0, match - 1);
    start += match - lps[match] + 1;
    match = lps[match];
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m;
  cin >> p;
  for (int i = 0; i < m; i++) {
    cin >> y[i];
    y[i]--;
  }
  q = p.size();
  long long ans = 1;
  int curr_ind = 0;
  for (int i = 0; i < n; i++) {
    if (curr_ind < m && i >= y[curr_ind] + q) {
      curr_ind++;
    }
    if (curr_ind < m && i < y[curr_ind] + q && i >= y[curr_ind]) {
      s += p[i - y[curr_ind]];
    } else {
      s += '?';
      ans = (ans * 26) % mod;
    }
  }
  compute_lps();
  kmp();
  for (int i = 0; i < m; i++) {
    if (!is_match[y[i]]) {
      cout << 0 << '\n';
      return 0;
    }
  }
  cout << ans << '\n';
  return 0;
}
