#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:66777216")
using namespace std;
const double eps = 1e-7;
const double pi = acos(-1.0);
const long long INF = (long long)2e9 + 1;
const long long LINF = (long long)8e18;
const long long inf = (long long)2e9 + 1;
const long long linf = (long long)8e18;
const long long MM = (long long)1e9 + 7;
int solve();
void gen();
int main() {
  solve();
  return 0;
}
int A[(int)(2e6 + 7)], Z[(int)(2e6 + 7)];
bool cmp(char a, char b) {
  if (a == (char)(0) || b == (char)(0)) return true;
  return a == b;
}
int solve() {
  int n, m;
  string s, p;
  cin >> n >> m >> p;
  for (int i = 0; i < (int)m; i++) {
    cin >> A[i];
    A[i] += p.size();
  }
  s = p + '#';
  for (int i = 0; i < n; i++) s += (char)(1);
  int N = n + p.size() + 1;
  int rr = 0;
  for (int i = 0; i < m; i++) {
    if (A[i] + p.size() - 1 > rr) {
      for (int k = max(rr, A[i]), g = k - A[i]; g < p.size(); k++, g++)
        s[k] = p[g];
      rr = A[i] + p.size() - 1;
    }
  }
  bool ok = true;
  for (int i = 0, j = 0, l = 0, r = 0; i < N; i++) {
    if (i) {
      if (i <= r) Z[i] = min(Z[i - l], r - i + 1);
      while (i + Z[i] < N && cmp(s[Z[i]], s[i + Z[i]])) Z[i]++;
      if (i + Z[i] - 1 > r) l = i, r = i + Z[i] - 1;
    }
  }
  for (int i = 0; i < (int)m; i++) {
    if (Z[A[i]] < p.size()) ok = false;
  }
  int c = 0;
  for (int i = 0; i < (int)s.size(); i++) c += s[i] == (char)(1);
  long long ans = 1;
  for (int i = 0; i < (int)c; i++) ans = (ans * 26) % MM;
  cout << ans * ok;
  return 0;
}
