#include <bits/stdc++.h>
using namespace std;
const long long MX = 1e6 + 9, MOD = 1e9 + 7;
long long pi[MX], ok[MX], mrk[MX], a[MX];
void KMP(string s) {
  long long n = s.size();
  for (long long i = 1; i < n; i++) {
    long long j = pi[i - 1];
    while (j > 0 && s[j] != s[i]) j = pi[j - 1];
    if (s[j] == s[i]) j++;
    pi[i] = j;
  }
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n, m, ans = 1;
  cin >> n >> m;
  string s;
  cin >> s;
  for (long long i = 0; i < m; i++) cin >> a[i], a[i]--;
  a[m] = n;
  KMP(s);
  long long x = pi[s.size() - 1];
  while (x > 0) {
    ok[s.size() - x] = 1;
    x = pi[x - 1];
  }
  for (long long i = 0; i < m; i++) {
    long long l = a[i + 1] - a[i];
    if (l < s.size() && !ok[l]) return cout << 0, 0;
    for (long long j = a[i]; j < a[i] + min(l, (long long)s.size()); j++)
      mrk[j] = 1;
  }
  for (long long i = 0; i < n; i++)
    if (!mrk[i]) ans = (ans * 26) % MOD;
  cout << ans;
  return 0;
}
