#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 1;
const int mod = 1e9 + 7;
int n, m, p;
char s[maxn];
char tar[maxn];
int f[maxn];
int main() {
  scanf("%d %d %s", &n, &m, s);
  p = strlen(s);
  memset(tar, 0, n * sizeof(tar[0]));
  vector<int> v(m);
  long long ans = 0;
  for (auto& e : v) scanf("%d", &e), --e;
  if (!v.empty() && v.back() + p > n)
    ans = 0;
  else {
    reverse(v.begin(), v.end());
    for (auto e : v) {
      for (int i = 0; i < p && !tar[i + e]; ++i) tar[i + e] = s[i];
    }
    for (int i = 0, j = f[0] = -1; i < p; ++i, ++j) {
      while (j != -1 && s[j] != s[i]) j = f[j];
      f[i + 1] = j + 1;
    }
    set<int> matches;
    for (int i = 0, j = 0; i < n; ++i) {
      while (j != -1 && s[j] != tar[i]) j = f[j];
      ++j;
      if (j == p) {
        matches.insert(i - p + 1);
        j = f[j];
      }
    }
    bool valid = true;
    for (auto e : v)
      if (!matches.count(e)) {
        valid = false;
        break;
      }
    if (valid) {
      ans = 1;
      for (int i = 0; i < n; ++i)
        if (tar[i] == 0) ans = ans * 26 % mod;
    }
  }
  printf("%lld\n", ans);
}
