#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, m;
  cin >> n >> m;
  vector<int> str(n + 1, -1);
  string p;
  cin >> p;
  vector<int> lcp(p.size(), 0);
  for (int i = 1; i < p.size(); i++) {
    int j = lcp[i - 1];
    while (j > 0 and p[j] != p[i]) j = lcp[j - 1];
    if (p[j] == p[i]) j++;
    lcp[i] = j;
  }
  vector<bool> ok(n + 1, 0);
  int j = p.size() - 1;
  while (j > 0) {
    ok[lcp[j]] = true;
    j = lcp[j - 1];
  }
  const int mod = 1e9 + 7;
  int ans = 1;
  int nxt = -1;
  for (int i = 0; i < m; i++) {
    int pos;
    cin >> pos;
    pos--;
    if (nxt < pos) {
      for (int j = pos; j < pos + p.size(); j++) str[j] = p[j - pos];
      nxt = pos + p.size() - 1;
      continue;
    }
    int len = nxt - pos + 1;
    if (not ok[len]) {
      ans = 0;
      break;
    } else {
      for (int j = pos + len; j < pos + p.size(); j++) str[j] = p[j - pos];
      nxt = pos + p.size() - 1;
    }
  }
  for (int i = 0; i < n; i++) {
    if (str[i] == -1) {
      ans = 1ll * ans * 26 % mod;
    }
  }
  cout << ans << "\n";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  solve();
  return 0;
}
