#include <bits/stdc++.h>
using namespace std;
long long i, j, tab[1000005], has[1000005], ans[1000005], n, m, pre, las, flag,
    a[1000005], ret;
string p;
void bt() {
  i = 0;
  j = 1;
  while (j < p.length()) {
    if (p[i] == p[j]) {
      i++;
      tab[j] = i;
      j++;
    } else {
      while (i && p[i] != p[j]) i = tab[i - 1];
      if (p[i] == p[j]) i++;
      tab[j] = i;
      j++;
    }
  }
}
int main() {
  cin >> n >> m;
  cin >> p;
  for (i = 0; i < m; i++) {
    scanf("%lld", &a[i]);
    a[i]--;
  }
  bt();
  i = p.length() - 1;
  while (tab[i]) {
    if (p[i] == p[0]) has[i] = 1;
    i--;
  }
  pre = a[0];
  las = a[0];
  flag = 1;
  for (i = 1; i < m; i++) {
    if (pre + p.length() > a[i]) {
      if (!has[a[i] - pre]) {
        flag = 0;
        break;
      }
      las = a[i];
    } else if (las + p.length() > a[i]) {
      pre = las;
      i--;
    } else {
      pre = a[i];
      las = a[i];
    }
  }
  if (!flag)
    cout << "0";
  else {
    for (i = 0; i < n; i++) ans[i] = 26;
    i = 0;
    j = a[i];
    while (i < m && j < n) {
      if (a[i] + p.length() > j) {
        ans[j] = 1;
        j++;
      } else {
        i++;
        j = max(a[i], j);
      }
    }
    ret = 1;
    for (i = 0; i < n; i++) {
      ret = (ret * ans[i]) % 1000000007;
    }
    cout << ret;
  }
  return 0;
}
