#include <bits/stdc++.h>
using namespace std;
template <class T>
ostream& operator<<(ostream& os, vector<T> V) {
  for (auto v : V) os << v << " ";
  return cout << "";
}
template <class T>
ostream& operator<<(ostream& os, set<T> S) {
  for (auto s : S) os << s << " ";
  return cout << "";
}
template <class L, class R>
ostream& operator<<(ostream& os, pair<L, R> P) {
  return os << P.first << " " << P.second;
}
long long mod = 1000000007;
long long inv(long long i) {
  if (i == 1) return 1;
  return (mod - ((mod / i) * inv(mod % i)) % mod) % mod;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
long long pwr(long long a, long long b) {
  a %= mod;
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return res;
}
int n;
string s;
vector<int> y;
vector<int> z;
int main() {
  int m;
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m >> s;
  int n0 = n;
  int unk = n - s.length();
  n = (int)s.length();
  int i;
  y.assign(m + 1, 0);
  for (i = 1; i <= m; i++) cin >> y[i];
  z.assign(n, 0);
  for (int i = 1, l = 0, r = 0; i < n; ++i) {
    if (i <= r) z[i] = min(r - i + 1, z[i - l]);
    while (i + z[i] < n && s[z[i]] == s[i + z[i]]) ++z[i];
    if (i + z[i] - 1 > r) {
      l = i;
      r = i + z[i] - 1;
    }
  }
  int fac = 1;
  for (i = 2; i <= m; i++) {
    unk = unk - min(n, y[i] - y[i - 1]);
    if (y[i] - y[i - 1] < n and z[y[i] - y[i - 1]] != n - y[i] + y[i - 1])
      fac = 0;
  }
  if (m == 0) {
    fac = 1;
    unk = n0;
  }
  cout << fac * (pwr(26, unk));
}
