#include <bits/stdc++.h>
using namespace std;
const int N = 1010101, P = 1e9 + 7, seed = 167, P2 = 1e9 + 9;
int n, m, len;
int x[N], ba[N], ha[N], ba2[N], ha2[N];
string s;
int mul(int a, int b, int P = ::P) { return 1ll * a * b % P; }
int add(int a, int b, int P = ::P) {
  int r = a + b;
  if (r >= P) r -= P;
  return r;
}
int sub(int a, int b, int P = ::P) {
  int r = a - b;
  if (r < 0) r += P;
  return r;
}
pair<int, int> get(int l, int r) {
  int r1 = sub(ha[r], mul(ha[l - 1], ba[r - l + 1]));
  int r2 = sub(ha2[r], mul(ha2[l - 1], ba2[r - l + 1], P2), P2);
  return make_pair(r1, r2);
}
int kpow(int a, int b) {
  int r = 1;
  while (b) {
    if (b & 1) r = mul(r, a);
    a = mul(a, a);
    b >>= 1;
  }
  return r;
}
bool check(int i) {
  if (x[i] - x[i - 1] - len >= 0) return 1;
  int t = len + x[i - 1] - x[i];
  return get(1, t) == get(len - t + 1, len);
}
int solve() {
  if (m == 0) return kpow(26, n);
  int cnt = x[1] - 1;
  for (int i = (2); i < (m + 1); i++) {
    if (check(i))
      cnt += max(0, x[i] - x[i - 1] - len);
    else
      return 0;
  }
  cnt += n + 1 - x[m] - len;
  return kpow(26, cnt);
}
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  cin >> n >> m >> s;
  for (int i = (1); i < (m + 1); i++) cin >> x[i];
  len = (int)s.size();
  s = " " + s;
  ba[0] = ba2[0] = 1;
  for (int i = (1); i < (len + 1); i++)
    ba[i] = mul(ba[i - 1], seed), ba2[i] = mul(ba2[i - 1], seed, P2);
  for (int i = (1); i < (len + 1); i++) {
    ha[i] = add(mul(ha[i - 1], seed), s[i]);
    ha2[i] = add(mul(ha2[i - 1], seed, P2), s[i], P2);
  }
  cout << solve() << "\n";
  return 0;
}
