#include <bits/stdc++.h>
using namespace std;
template <class T>
vector<int> zFunction(const T& s, int n) {
  int l = 0, r = 0;
  vector<int> z(n);
  for (int i = 1; i < n; i++) {
    if (i <= r) {
      z[i] = min(z[i - l], r - i + 1);
    }
    while (i + z[i] < n && s[i + z[i]] == s[z[i]]) {
      z[i]++;
    }
    if (i + z[i] - 1 > r) {
      l = i;
      r = i + z[i] - 1;
    }
  }
  return z;
}
int main() {
  int n, m;
  string p;
  cin >> n >> m >> p;
  vector<int> y(m);
  for (auto& x : y) {
    cin >> x;
    x--;
  }
  auto z = zFunction(p, (int)p.size());
  for (int i = 1; i < m; i++) {
    if (y[i] - y[i - 1] < (int)p.size()) {
      if (y[i] - y[i - 1] + z[y[i] - y[i - 1]] < (int)p.size()) {
        cout << "0\n";
        return 0;
      }
    }
  }
  const int M = 1000 * 1000 * 1000 + 7;
  int ans = 1;
  for (int i = 0, j = -1; i < n; i++) {
    if (j + 1 < m && y[j + 1] <= i) {
      j++;
    }
    if (j == -1 || i - y[j] >= (int)p.size()) {
      ans = (long long)ans * 26LL % M;
    }
  }
  cout << ans << "\n";
}
