#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
int *z_function(char *s, int n) {
  int *z = new int[n];
  z[0] = 0;
  for (int l = 0, r = 0, i = 1; i < n; i++) {
    z[i] = (i <= r) ? min(r - i + 1, z[i - l]) : 0;
    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 n, pn, m;
char p[1000001];
int y[1000001];
int main() {
  scanf("%d %d", &n, &m);
  cin >> p;
  pn = strlen(p);
  int *z = z_function(p, pn);
  for (int i = 0; i < m; i++) scanf("%d", &y[i]);
  for (int p1 = 0, p2 = 1; p2 < m;) {
    while (p2 < m && y[p2] - y[p1] >= pn) p1++, p2++;
    if (p2 < m && z[y[p2] - y[p1]] < pn - (y[p2] - y[p1])) {
      cout << 0 << endl;
      return 0;
    } else
      p1++, p2++;
  }
  long long ans = 1;
  int k = (m ? 0 : n), r = 0;
  for (int i = 0; i < m; i++) {
    if (y[i] > r + 1) k += y[i] - r - 1;
    r = y[i] + pn - 1;
  }
  if (m && r < n) k += n - r;
  for (int i = 0; i < k; i++) ans = (ans * 26) % mod;
  cout << ans << endl;
  return 0;
}
