#include <bits/stdc++.h>
using namespace std;
inline long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
inline long long power(long long a, long long n, long long m) {
  if (n == 0) return 1;
  long long p = power(a, n / 2, m);
  p = (p * p) % m;
  if (n % 2)
    return (p * a) % m;
  else
    return p;
}
const long long MOD = 1000000007;
const int N = int(3e5) + 999;
vector<vector<long long int>> g;
vector<long long int> vis;
map<pair<long long int, long long int>, long long int> m;
int32_t main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int n, m;
  cin >> n >> m;
  string p;
  cin >> p;
  long long int pi[p.size()];
  pi[0] = 0;
  for (long long int i = 1; i < p.size(); i++) {
    long long int j = pi[i - 1];
    while (j > 0 and p[i] != p[j]) j = pi[j - 1];
    if (p[i] == p[j]) j++;
    pi[i] = j;
  }
  map<long long int, long long int> mt;
  long long int jj = pi[p.size() - 1];
  while (jj > 0) {
    mt[jj] = 1;
    jj = pi[jj - 1];
  }
  mt[0] = 1;
  vector<long long int> st;
  long long int prev, el;
  if (m) {
    cin >> prev;
    st.push_back(prev);
  }
  bool ok = true;
  for (long long int i = 0; i < m - 1; i++) {
    cin >> el;
    st.push_back(el);
    if (prev + p.size() - el > 0)
      if (!mt[prev + p.size() - el]) ok = false;
    prev = el;
  }
  if (ok == false) {
    cout << 0;
    return 0;
  }
  for (long long int i = 0; i < st.size(); i++) {
    long long int tmp = 0;
    if (i + 1 < st.size() and st[i] + p.size() - 1 >= st[i + 1]) {
      tmp = st[i + 1] - st[i];
    } else {
      tmp = p.size();
    }
    n -= (tmp);
  }
  long long int ans = power(26, n, MOD);
  if (ans < 0) ans += MOD;
  cout << ans;
}
