#include <bits/stdc++.h>
using namespace std;
const int64_t mod = 1e9 + 7;
int modpow(int64_t u, int v) {
  int64_t ans = 1;
  while (v) {
    if (v & 1) {
      ans = ans * u;
      ans -= (ans / mod) * mod;
    }
    v >>= 1;
    u = u * u;
    u -= (u / mod) * mod;
  }
  return ans;
}
int32_t main() {
  int n, m;
  cin >> n >> m;
  string p;
  cin >> p;
  int k = p.size();
  vector<int> ss(m);
  for (int &it : ss) {
    cin >> it;
    it--;
  }
  vector<bool> st(n);
  for (int &it : ss) {
    st[it] = true;
  }
  string ans(n, '?');
  int occ = n;
  int lst = -1;
  for (int i = 0; i < n; i++) {
    if (st[i]) {
      lst = i;
    }
    if (i - lst < k && lst != -1) {
      ans[i] = p[i - lst];
      occ--;
    }
  }
  p += "#" + ans;
  vector<int> pi(n + k + 5);
  int l = 0;
  for (int i = 1; i < p.size(); i++) {
    while (l && p[i] != p[l]) {
      l = pi[l - 1];
    }
    if (p[i] == p[l]) {
      l++;
    }
    pi[i] = l;
  }
  int64_t stp = 1;
  for (int i = k + 1; i < n + k; i++) {
    if (st[i - k - 1] && pi[i + k - 1] - k) {
      stp = 0;
    }
  }
  stp *= modpow(26, occ);
  cout << stp;
}
