#include <bits/stdc++.h>
using namespace std;
const int N(1e6 + 200);
const int MOD(1e9 + 7);
char s[N];
int n, m, len, y[N], nxt[N], cnt;
bool vis[N], v[N], a[N];
inline int power(int x, int k) {
  int res(1);
  for (; k; k >>= 1) {
    if (k & 1) res = (long long)res * x % MOD;
    x = (long long)x * x % MOD;
  }
  return res;
}
int main() {
  scanf("%d%d", &n, &m);
  scanf("%s", s + 1);
  len = strlen(s + 1);
  for (int i(1); i <= m; i++) scanf("%d", y + i), v[y[i]] = 1;
  for (int i(2), j(0); i <= len; i++) {
    while (j && s[j + 1] != s[i]) j = nxt[j];
    nxt[i] = s[j + 1] == s[i] ? ++j : j;
  }
  for (int i(len); i; i = nxt[i]) vis[i] = 1;
  int last = 0, ri = 1;
  for (int i(1); i <= n; i++)
    if (!v[i] && !a[i])
      cnt++;
    else if (v[i]) {
      if (!a[i])
        ;
      else {
        if (!vis[last + len - i]) {
          puts("0");
          return 0;
        }
      }
      last = i;
      for (int j(max(ri, i)); j < i + len; j++) a[j] = 1;
      ri = i + len;
    }
  int ans(1);
  for (int i(1); i <= n; i++)
    if (!a[i]) ans = (long long)ans * 26 % MOD;
  cout << ans << endl;
  return 0;
}
