#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  string s;
  s.reserve(1000000);
  cin >> n >> m >> s;
  vector<int> p;
  p.resize(m);
  for (int i = 0; i < m; ++i) {
    cin >> p[i];
    --p[i];
  }
  int prev = -1;
  int l = s.size();
  vector<int> T(l);
  T[0] = -1;
  T[1] = 0;
  for (int pos = 2, cnd = 0; pos < l;) {
    if (s[pos - 1] == s[cnd])
      T[pos++] = ++cnd;
    else if (cnd > 0)
      cnd = T[cnd];
    else
      T[pos++] = 0;
  }
  int first = 1;
  for (int i = 0; i + first < l;) {
    if (s[i] == s[first + i]) {
      if (i + first == l - 1) break;
      ++i;
    } else {
      if (T[i] > -1) {
        first += i - T[i];
        i = T[i];
      } else
        i = 0, ++first;
    }
  }
  vector<char> canstart(l, 0);
  for (int i = first; i < l; i += first) canstart[i] = 1;
  int unknown = n;
  for (int x : p) {
    if (x + l > n) {
      cout << 0 << endl;
      return 0;
    }
    if (prev > x)
      if (!canstart[x - (prev - l)]) {
        cout << 0 << endl;
        return 0;
      }
    unknown -= x + l - max(prev, x);
    prev = x + l;
  }
  uint64_t result = 1;
  while (unknown--) {
    result *= 26;
    result %= 1000000007;
  }
  cout << result << endl;
  return 0;
}
