#include <bits/stdc++.h>
using namespace std;
const long long int inf = 1e18;
int t = 1, n, m;
string p;
vector<int> ind;
char s[1000001];
vector<bool> rec(1e6 + 1, false);
vector<int> Z(1e6 + 1, 0);
void getZarr(string str) {
  int n = str.length();
  int L, R, k;
  L = R = 0;
  for (int i = 1; i < n; ++i) {
    if (i > R) {
      L = R = i;
      while (R < n && str[R - L] == str[R]) R++;
      Z[i] = R - L;
      R--;
    } else {
      k = i - L;
      if (Z[k] < R - i + 1)
        Z[i] = Z[k];
      else {
        L = i;
        while (R < n && str[R - L] == str[R]) R++;
        Z[i] = R - L;
        R--;
      }
    }
  }
}
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  cin >> n >> m >> p;
  ind.resize(m);
  ;
  for (int i = 0; i < m; i++) {
    cin >> ind[i];
    ind[i]--;
  }
  getZarr(p);
  if (m >= 1) {
    ;
    for (int j = ind[0]; j < ind[0] + p.size(); j++) {
      rec[j] = true;
      s[j] = p[j - ind[0]];
    }
  };
  for (int i = 1; i < m; i++) {
    if (ind[i] - ind[i - 1] >= p.size()) {
      ;
      for (int j = ind[i]; j < ind[i] + p.size(); j++) {
        rec[j] = true;
        s[j] = p[j - ind[i]];
      }
    } else {
      t = ind[i] - ind[i - 1];
      if (Z[t] == ind[i - 1] + p.size() - ind[i]) {
        ;
        for (int j = ind[i - 1] + p.size(); j < ind[i] + p.size(); j++) {
          rec[j] = true;
          s[j] = p[j - ind[i]];
        }
      } else {
        cout << 0 << endl;
        return 0;
      }
    }
  }
  long long int ans = 1;
  ;
  for (int i = 0; i < n; i++) {
    if (!rec[i]) {
      ans *= 26;
      ans %= 1000000007;
    }
  }
  cout << ans << endl;
}
