#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, m;
  cin >> n >> m;
  string str;
  cin >> str;
  vector<int> v(m);
  for (int i = 0; i < m; ++i) {
    cin >> v[i];
  }
  vector<int> z(str.size());
  for (int i = 1, l = 0, r = 0; i < str.size(); ++i) {
    if (i <= r) z[i] = min(r - i + 1, z[i - l]);
    while (i + z[i] < n && str[z[i]] == str[i + z[i]]) ++z[i];
    if (i + z[i] - 1 > r) l = i, r = i + z[i] - 1;
  }
  for (int i = 1; i < m; ++i) {
    int cur = v[i];
    int pref = v[i - 1];
    int diff = cur - pref;
    if (diff < z.size() && diff + z[diff] < str.size()) {
      cout << 0 << endl;
      return 0;
    }
  }
  vector<int> dp(n);
  for (int i = 0; i < m; ++i) {
    dp[v[i] - 1] += 1;
    if (v[i] - 1 + str.size() < n) dp[v[i] - 1 + str.size()] -= 1;
  }
  int64_t ret = 1, inf = 1000000007;
  for (int i = 0; i < n; ++i) {
    if (i) dp[i] += dp[i - 1];
    int64_t val = 26;
    if (dp[i] > 0) val = 1;
    ret = ret * val;
    ret %= inf;
  }
  cout << ret << endl;
  return 0;
}
