#include <bits/stdc++.h>
using namespace std;
const int N = 1000000 + 121, mod = 1000000007;
int z[N], x[N], n, m, ans;
string s;
int bpow(int n, int k) {
  int res = 1;
  for (int i = 0; i < 25; i++) {
    if (k & (1 << i)) res = 1ll * res * n % mod;
    n = 1ll * n * n % mod;
  }
  return res;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ;
  cin >> n >> m >> s;
  if (m == 0) {
    cout << bpow(26, n) << endl;
    return 0;
  }
  for (int i = 0; i < m; i++) {
    cin >> x[i];
    x[i]--;
  }
  int sz = s.size();
  z[0] = sz;
  int l = 0, r = 0;
  for (int i = 1; i < sz; i++) {
    if (i >= r) {
      l = r = i;
      while (r < s.size() && s[r - l] == s[r]) r++;
      z[i] = r - l;
    } else {
      if (z[i - l] >= r) {
        l = i;
        while (r < s.size() && s[r - l] == s[r]) r++;
        z[i] = r - l;
      } else {
        z[i] = z[i - l];
      }
    }
  }
  int R = 0;
  for (int i = 0; i < m; i++) {
    ans += max(0, x[i] - R);
    if (x[i] < R) {
      int g = R - x[i];
      if (z[sz - g] < g) {
        cout << 0 << endl;
        return 0;
      }
    }
    R = x[i] + sz;
  }
  ans += n - x[m - 1] - sz;
  cout << bpow(26, ans) << endl;
}
