#include <bits/stdc++.h>
using namespace std;
const int MX = 2000000, MOD = 1000000007;
int n, m, tab[MX], x;
long long res;
vector<int> v;
string p, s;
bool check() {
  string w = p + "#" + s;
  tab[0] = 0;
  for (int i = 1; i < (int)w.size(); ++i) {
    int k = tab[i - 1];
    while (k && w[k] != w[i]) k = tab[k - 1];
    if (w[k] == w[i])
      tab[i] = k + 1;
    else
      tab[i] = 0;
  }
  for (auto x : v) {
    if (tab[x + 2 * p.size()] != (int)p.size()) return false;
  }
  return true;
}
int main() {
  cin >> n >> m;
  cin >> p;
  for (int i = 0; i < m; ++i) {
    cin >> x;
    v.push_back(--x);
  }
  for (int i = 0; i < n; ++i) tab[i] = '?';
  int k = p.size(), vit = 0;
  for (int i = 0; i < n; ++i) {
    if (vit < (int)v.size() && i == v[vit]) {
      vit++;
      k = 0;
    }
    if (k < (int)p.size()) {
      s += p[k];
      k++;
    } else
      s += '?';
  }
  if (!check()) {
    cout << 0;
    return 0;
  }
  res = 1;
  for (int i = 0; i < n; ++i)
    if (s[i] == '?') {
      res *= 26;
      res %= MOD;
    }
  cout << res;
  return 0;
}
