#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const ll OO = 1e18, oo = 1e12 + 21;
int di[8] = {0, 0, 1, -1, -1, 1, -1, 1};
int dj[8] = {1, -1, 0, 0, 1, 1, -1, -1};
string ys = "YES", no = "NO";
const long double dgr = acos(-1) / 180, rad = 180 / acos(-1);
const ll mod = 1e9 + 7, N = 1e6 + 5, M = 5005;
int LP[N];
char t[N];
string s, p;
int n, m;
void failure_function() {
  for (int k = 0, i = 1; i < p.size(); i++) {
    while (k > 0 && p[k] != p[i]) k = LP[k - 1];
    if (p[k] == p[i]) LP[i] = ++k;
    LP[i] = k;
  }
}
bool found[N];
void KMP() {
  for (int k = 0, i = 0; i < s.size(); i++) {
    while (k > 0 && s[i] != p[k]) k = LP[k - 1];
    k += (s[i] == p[k]);
    if (k == p.size()) found[i - p.size() + 1]++, k = LP[k - 1];
  }
}
ll fast_power(ll base, ll power) {
  ll ans = 1;
  while (power > 0) {
    if (power & 1) ans = (ans * base) % mod;
    base = (base * base) % mod;
    power >>= 1;
  }
  return ans;
}
int l, power;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, m;
  cin >> n >> m >> p;
  vector<int> v(m);
  for (auto &i : v) cin >> i, i--;
  set<int> st;
  for (int i = 0; i < n; i++) st.insert(i);
  s = string(n, 'a');
  for (int i = 0; i < m; i++) {
    int indx = v[i];
    auto it = st.lower_bound(indx);
    for (int j = *it; j < indx + p.size(); j++) {
      st.erase(j);
      s[j] = p[j - indx];
    }
  }
  failure_function();
  KMP();
  for (int i = 0; i < m; i++)
    if (!found[v[i]]) return cout << 0 << '\n', 0;
  cout << fast_power(26, st.size()) << '\n';
}
