#include <bits/stdc++.h>
using namespace std;
const int mn = 2e6, mod = 1e9 + 7;
int n, m, p[mn], Fail[mn], t[mn];
char s[mn];
int main() {
  cin >> n >> m;
  scanf("%s", s);
  int len = strlen(s);
  Fail[0] = -1;
  for (int i = 0, j = -1; i < len;)
    if (j == -1 || s[i] == s[j])
      Fail[++i] = ++j;
    else
      j = Fail[j];
  for (int i = 0; i < m; i++) {
    scanf("%d", p + i);
    if (i) t[i - 1] = p[i - 1] - p[i] + len;
  }
  if (m) sort(t, t + m - 1);
  int tt = m ? unique(t, t + m - 1) - t : 0;
  for (int now = Fail[len]; now != -1; now = Fail[now]) {
    while (t[tt - 1] >= len) tt--;
    if (tt && now < t[tt - 1]) {
      puts("0");
      return 0;
    }
    if (tt && now == t[tt - 1]) tt--;
  }
  int ans = 1, pt = 0, ml = 0;
  for (int i = 1; i <= n; i++) {
    if (i == p[pt]) ml = i + len - 1, pt++;
    if (i > ml) ans = 26ll * ans % mod;
  }
  cout << ans << endl;
  return 0;
}
