#include <bits/stdc++.h>
using namespace std;
int const MAXN = 1e6 + 9;
int const MOD = 1e9 + 7;
int F[MAXN];
int a[MAXN];
long long int mypow(int a, int b) {
  if (b == 0) return 1;
  long long int ret = 1;
  if (b % 2) ret = a;
  long long int x = mypow(a, b / 2);
  return (((x * x) % MOD) * ret) % MOD;
}
void pre(string p) {
  int n = p.size();
  for (int i = 1, j = 0; i < n; i++) {
    while (j > 0 && p[i] != p[j]) j = F[j - 1];
    if (p[i] == p[j])
      F[i] = ++j;
    else
      F[i] = j;
  }
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  int n, q;
  string s;
  cin >> n >> q;
  cin >> s;
  pre(s);
  for (int i = 0; i < q; i++) {
    cin >> a[i];
    if (a[i] + s.size() - 1 > n) {
      cout << "0";
      return 0;
    }
  }
  long long int ans = 1;
  for (int i = 1; i < q; i++) {
    int dif = a[i] - a[i - 1];
    if (dif >= s.size()) {
      ans = (ans * mypow(26, dif - s.size())) % MOD;
    } else {
      int l = s.size() - dif;
      int k = s.size() - 1;
      bool cond = false;
      while (k > 0) {
        if (F[k] == l) {
          cond = true;
          break;
        }
        k = F[k - 1];
      }
      if (!cond) {
        cout << "0";
        return 0;
      }
    }
  }
  if (q) {
    int x = n - (a[q - 1] + s.size() - 1);
    ans = (ans * mypow(26, x)) % MOD;
    x = a[0] - 1;
    if (x > 0) ans = (ans * mypow(26, x)) % MOD;
  } else
    ans = (ans * mypow(26, n)) % MOD;
  cout << ans << "\n";
}
