#include <bits/stdc++.h>
using namespace std;
vector<int> z_function(string s) {
  int n = (int)s.length();
  vector<int> z(n);
  for (int i = 1, l = 0, r = 0; i < n; ++i) {
    if (i <= r) z[i] = min(r - i + 1, z[i - l]);
    while (i + z[i] < n && s[z[i]] == s[i + z[i]]) ++z[i];
    if (i + z[i] - 1 > r) l = i, r = i + z[i] - 1;
  }
  return z;
}
long long modu = (long long)(1e9 + 7);
int main() {
  int n, k;
  cin >> n >> k;
  string pal;
  cin >> pal;
  vector<int> v(k);
  vector<int> z = z_function(pal);
  long long ans = 1;
  long long cont = 0;
  for (int i = (int)0; i < (int)k; i++) cin >> v[i];
  for (int i = (int)0; i < (int)k; i++) {
    if (i == 0) {
      cont += (long long)pal.size();
      continue;
    }
    if (v[i] - v[i - 1] < pal.size()) {
      int pos = v[i] - v[i - 1];
      if (z[pos] + pos >= pal.size()) {
        cont += pos;
      } else
        ans = 0;
    } else
      cont += pal.size();
  }
  for (int i = (int)0; i < (int)n - cont; i++) ans *= 26LL, ans %= modu;
  cout << ans << "\n";
  return 0;
}
