#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int N = 1e6 + 10;
const int lgN = 21;
char s[N];
int a[N];
int n, m, o;
int c[lgN][N];
void sufarr() {
  static int p[N];
  static vector<int> cnt[N];
  int ccnt = 0;
  for (int i = (0); i < (n); ++i) cnt[s[i]].push_back(i);
  for (int i = (0); i < (256); ++i) {
    reverse(cnt[i].begin(), cnt[i].end());
    while (cnt[i].size()) p[ccnt++] = cnt[i].back(), cnt[i].pop_back();
  }
  c[0][p[0]] = 0;
  for (int i = (1); i < (n); ++i)
    c[0][p[i]] = c[0][p[i - 1]] + (s[p[i]] != s[p[i - 1]]);
  for (int k = (0); k < (lgN - 1); ++k) {
    ccnt = 0;
    for (int i = (0); i < (n); ++i)
      cnt[c[k][((p[i] - (1 << k)) % n + n) % n]].push_back(
          ((p[i] - (1 << k)) % n + n) % n);
    for (int i = (0); i < (n); ++i) {
      if (cnt[i].empty()) continue;
      reverse(cnt[i].begin(), cnt[i].end());
      while (cnt[i].size()) p[ccnt++] = cnt[i].back(), cnt[i].pop_back();
    }
    c[k + 1][p[0]] = 0;
    for (int i = (1); i < (n); ++i)
      c[k + 1][p[i]] = c[k + 1][p[i - 1]] + (c[k][p[i - 1]] != c[k][p[i]] ||
                                             c[k][(p[i - 1] + (1 << k)) % n] !=
                                                 c[k][(p[i] + (1 << k)) % n]);
  }
}
int lcp(int a, int b) {
  int ans = 0;
  for (int k = (lgN)-1; k >= (0); --k) {
    if (c[k][a] == c[k][b]) {
      ans += 1 << k;
      a += 1 << k;
      b += 1 << k;
    }
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  ;
  cin >> m >> o;
  cin >> s;
  n = strlen(s) + 1;
  sufarr();
  for (int i = (0); i < (o); ++i) {
    cin >> a[i];
    a[i]--;
    if (i && a[i] - a[i - 1] < n - 1) {
      int x = lcp(0, a[i] - a[i - 1]);
      if (a[i] - a[i - 1] + x != n - 1) return cout << (0) << '\n', 0;
    }
  }
  long long ans = 1;
  int lst = -1;
  for (int i = (0); i < (m); ++i) {
    if (lst + 1 < o && a[lst + 1] <= i) lst++;
    if (!~lst || a[lst] + n - 1 <= i) ans = ans * 26 % mod;
  }
  cout << ans << '\n';
}
