#include <bits/stdc++.h>
using namespace std;
const int N = 1000010;
const int mod = 1000000007;
int n, m, kq, len;
string p;
int nxt[N], a[N];
bool dd[N];
int main() {
  cin >> n >> m >> p;
  len = p.size();
  p = ' ' + p;
  for (int i = 1; i <= m; ++i) cin >> a[i];
  int k = 0;
  nxt[1] = 0;
  for (int i = 2; i <= len; ++i) {
    k = nxt[i - 1];
    while (k && p[i] != p[k + 1]) k = nxt[k];
    if (p[i] == p[k + 1]) k++;
    nxt[i] = k;
  }
  k = nxt[len];
  while (k) {
    dd[k] = true;
    k = nxt[k];
  }
  a[m + 1] = n + 1;
  a[0] = -len + 1;
  for (int i = 1; i <= m + 1; ++i) {
    if (a[i] > a[i - 1] + len - 1) {
      kq += a[i] - a[i - 1] - len;
    } else {
      int tg = a[i - 1] + len - a[i];
      if (!dd[tg]) {
        cout << 0;
        return 0;
      }
    }
  }
  long long res = 1;
  for (int i = 1; i <= kq; ++i) res = (res * 26) % mod;
  cout << res;
}
