#include <bits/stdc++.h>
using namespace std;
const int mxn = 1e5 + 5;
const int mod = 1e9 + 7;
const int mod1 = 998244353;
int powe(int y, long long int x = 26) {
  long long int s = 1;
  while (y) {
    if (y & 1) s = (s * x) % mod;
    y /= 2, x = (x * x) % mod;
  }
  return s;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n, p, m, i, pre;
  string s;
  cin >> n >> p >> s;
  m = s.size();
  vector<int> pi(m);
  vector<bool> c(m), vis(n + 1);
  for (i = 1; i < m; i++) {
    int j = pi[i - 1];
    while (j && s[i] - s[j]) j = pi[j - 1];
    pi[i] = j + (s[i] == s[j]);
  }
  int f = pi[m - 1];
  while (f) c[f] = 1, f = pi[f - 1];
  for (i = 0; i < p; i++) {
    int x;
    cin >> x;
    int a = x;
    if (vis[x]) {
      int f = m - x + pre;
      if (!c[f]) return cout << "0\n", 0;
      a = pre + m;
    }
    for (int j = a; j < x + m; j++) vis[j] = 1;
    pre = x;
  }
  int x = 0;
  for (i = 1; i <= n; i++) x += (vis[i] == 0);
  cout << powe(x) << endl;
}
