#include <bits/stdc++.h>
using namespace std;
const int Maxn = 1e6 + 10;
const int Mod = 1e9 + 7;
const int INF = 0x3f3f3f3f;
long long Next[Maxn];
long long n, m, len, ans;
string s;
vector<bool> vis(Maxn, false);
vector<long long> a;
void getNext() {
  Next[0] = -1;
  long long k = -1, j = 0;
  while (j < len) {
    if (k == -1 || s[j] == s[k])
      Next[++j] = ++k;
    else
      k = Next[k];
  }
}
void Dfs(long long k) {
  if (k == 0) return;
  vis[len - k + 1] = true;
  Dfs(Next[k]);
}
long long solve(long long k) {
  long long res = 1;
  if (k < 0) return 0;
  for (long long i = 1; i <= k; i++) res = (res * 26) % Mod;
  return res;
}
int main() {
  cin >> n >> m;
  cin >> s;
  len = s.size();
  getNext();
  Dfs(Next[len]);
  ans = 1;
  int flag = 0;
  if (m == 0)
    cout << solve(n) << endl;
  else {
    a.resize(Maxn, 0);
    cin >> a[1];
    ans = ans * solve(a[1] - 1);
    for (long long i = 2; i <= m; i++) {
      cin >> a[i];
      if (a[i] - a[i - 1] < len) {
        if (!vis[a[i] - a[i - 1] + 1]) {
          flag = 1;
          cout << 0 << endl;
          return 0;
        }
      } else
        ans = (ans * solve(a[i] - a[i - 1] - len)) % Mod;
    }
    if (flag == 0) {
      ans = (ans * solve(n - a[m] - len + 1)) % Mod;
      cout << ans << endl;
    }
  }
  return 0;
}
