#include <bits/stdc++.h>
using namespace std;
int n, m;
string s;
long long ans = 1;
int a[2000002];
long long h[2000002], h2[2000002];
long long deg[2000002], deg2[2000002];
void init() {
  srand(time(0));
  int p1 = max(30, rand());
  int p2 = max(30, rand());
  deg[0] = deg2[0] = 1;
  for (int i = 1; i < 2000002; i++) deg[i] = (deg[i - 1] * p1) % 1000000007;
  for (int i = 1; i < 2000002; i++) deg2[i] = (deg2[i - 1] * p2) % 1073676287;
  h[0] = h2[0] = s[0] - 'a' + 1;
  for (int i = 1; i < s.size(); i++)
    h[i] = (h[i - 1] + (long long)(s[i] - 'a' + 1) * deg[i]) % 1000000007;
  for (int i = 1; i < s.size(); i++)
    h2[i] = (h2[i - 1] + (long long)(s[i] - 'a' + 1) * deg2[i]) % 1073676287;
}
bool check(int l, int r, int le, int ri) {
  pair<long long, long long> H, H2;
  H.first = h[r];
  H.second = h2[r];
  if (l > 0) {
    H.first = (H.first - h[l - 1] + 1000000007) % 1000000007;
    H.second = (H.second - h2[l - 1] + 1073676287) % 1073676287;
  }
  H.first = (H.first * deg[s.size() - l]) % 1000000007;
  H.second = (H.second * deg2[s.size() - l]) % 1073676287;
  H2.first = (h[ri] - h[le - 1] + 1000000007) % 1000000007;
  H2.second = (h2[ri] - h2[le - 1] + 1073676287) % 1073676287;
  H2.first = (H2.first * deg[s.size() - le]) % 1000000007;
  H2.second = (H2.second * deg2[s.size() - le]) % 1073676287;
  return (H == H2);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m >> s;
  init();
  for (int i = 0; i < m; i++) {
    int p;
    cin >> p;
    a[--p] = 1;
  }
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] && i + s.size() > n) {
      cout << 0 << endl;
      return 0;
    }
    if (a[i]) cnt = s.size();
    if (cnt > 0) {
      cnt--;
      continue;
    }
    ans = (ans * 26) % 1000000007;
  }
  int x = -1000000000, y = -1000000000 / 2;
  for (int i = 0; i < n; i++) {
    if (a[i]) {
      x = y;
      y = i;
      if (y - x >= s.size()) continue;
      if (!check(y - x, s.size() - 1, 0, x + s.size() - 1 - y)) {
        cout << 0 << endl;
        return 0;
      }
    }
  }
  cout << ans << endl;
}
