#include <bits/stdc++.h>
const int mod = 1E9 + 7;
const int intmax = 1E9 + 7;
using namespace std;
int hs[1000006];
int mark[1000006];
int lps[1000006];
long long power(long long b, long long exp, long long m) {
  long long ans = 1;
  b %= m;
  while (exp) {
    if (exp & 1) ans = (ans * b) % m;
    exp >>= 1;
    b = (b * b) % m;
  }
  return ans;
}
void cal_lps(string &p) {
  lps[0] = -1;
  int j = -1;
  int i = 0;
  while (i < p.size()) {
    while (j >= 0 && p[i] != p[j]) j = lps[j];
    i++;
    j++;
    lps[i] = j;
  }
  int len = lps[p.size()];
  while (len) {
    hs[len] = 1;
    len = lps[len];
  }
}
int main() {
  int n, m, a;
  string s;
  scanf("%d", &n);
  scanf("%d", &m);
  cin >> s;
  cal_lps(s);
  for (int i = 0; i < m; i++) {
    cin >> a;
    mark[a] = 1;
  }
  int prevfinalidx = 0;
  int l = s.size();
  int count_ = 0;
  int i;
  for (i = 1; i <= n; i++) {
    if (!mark[i]) continue;
    if (prevfinalidx < i)
      count_ += i - prevfinalidx - 1;
    else {
      int reqlen = prevfinalidx - i + 1;
      if (!hs[reqlen]) {
        cout << "0";
        return 0;
      }
    }
    prevfinalidx = i + l - 1;
  }
  count_ += max(0, i - prevfinalidx - 1);
  cout << power(26, count_, mod);
}
