#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 50, mod = 1e9 + 7;
int power(int b, int p) {
  if (!p) return 1;
  int res = power(b, p / 2);
  res = (res * 1ll * res) % mod;
  if (p % 2) res = (res * 1ll * b) % mod;
  return res;
}
int n, m, sz;
string p;
vector<int> v;
char s[N];
bool st[N];
set<int> can;
vector<int> Zalgo(string s) {
  vector<int> z(s.size() + 5);
  int l = 0, r = 0;
  for (int i = 1; i < s.size(); i++) {
    if (r < i) {
      l = r = i;
      while (r < s.size() && s[r] == s[r - l]) r++;
      z[i] = r - l;
      r--;
    } else {
      int k = i - l;
      if (z[k] < r - i + 1)
        z[i] = z[k];
      else {
        l = i;
        while (r < s.size() && s[r] == s[r - l]) r++;
        z[i] = r - l;
        r--;
      }
    }
  }
  return z;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> p;
  sz = p.size();
  auto Z = Zalgo(p + "#" + p);
  for (int i = 0; i < sz; i++) can.insert(2 * sz - Z[i + 1 + sz]);
  v.resize(m);
  for (auto &i : v) cin >> i, st[i - 1] = 1;
  memset(s, '.', sizeof s);
  for (int i = 1; i < m; i++) {
    int d = v[i] - v[i - 1];
    if (d >= sz) continue;
    if (can.find(d + sz) == can.end()) return cout << "0", 0;
  }
  int cur = -1, tot = 0;
  for (int i = 0; i < n; i++) {
    if (st[i]) cur = 0;
    if (cur > -1 && cur < p.size()) s[i] = p[cur++];
  }
  for (int i = 0; i < n; i++) tot += s[i] == '.';
  cout << power(26, tot);
}
