#include <bits/stdc++.h>
using namespace std;
vector<int> z_function(const string& s) {
  int n = s.size();
  vector<int> z(n);
  for (int i = 1, l = 0, r = 0; i < n; ++i) {
    if (i <= r) z[i] = min(z[i - l], r - i + 1);
    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;
}
const int mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(0);
  int n, m;
  string s;
  cin >> n >> m >> s;
  vector<int> a(m);
  for (int i = 0; i < m; ++i) {
    cin >> a[i];
    a[i]--;
  }
  auto z = z_function(s);
  bool ok = 1;
  for (int i = 0; i < m; ++i) {
    ok &= (a[i] + s.size() <= n);
    if (i > 0) {
      int j = a[i] - a[i - 1];
      if (j >= s.size()) continue;
      ok &= (j + z[j] == s.size());
    }
  }
  if (!ok) {
    cout << 0;
    return 0;
  }
  vector<int> ban(n);
  int pre = -1;
  for (int i = 0; i < m; ++i) {
    for (int j = max(a[i], pre + 1); j < a[i] + s.size(); ++j) {
      ban[j] = 1;
    }
    pre = a[i] + s.size() - 1;
  }
  long long ans = 1;
  for (int i = 0; i < n; ++i) {
    if (!ban[i]) {
      ans = (ans * 26) % mod;
    }
  }
  cout << ans;
  return 0;
}
