#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void smax(T &x, T y) {
  x = max((x), (y));
}
template <class T>
inline void smin(T &x, T y) {
  x = min((x), (y));
}
const int MOD = 1e9 + 7;
const int SIZE = 1e6 + 10;
const int BASE = 26;
const double EPS = 1e-6;
int n, m;
string p;
int h[SIZE];
int y[SIZE];
bool ok[SIZE];
int p26[SIZE];
bool used[SIZE];
int mod(long long x) {
  while (x < 0) x += MOD;
  return x % MOD;
}
int modpow(int a, int p) {
  a = mod(a);
  int r = 1;
  while (p)
    r = (p & 1 ? mod((long long)r * a) : r), a = mod((long long)a * a), p >>= 1;
  return r;
}
int main() {
  ios_base::sync_with_stdio(0);
  if (0) {
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
  }
  memset((p26), 0, sizeof((p26)));
  p26[0] = 1;
  for (int i = (1); i < (SIZE); ++i) p26[i] = mod((long long)p26[i - 1] * 26);
  while (cin >> n >> m) {
    cin >> p;
    if (m == 0) {
      printf("%d\n", p26[n]);
      continue;
    }
    int sz = ((int)(p).size());
    int cur = 1;
    for (int i = (sz - 1); i >= 0; --i)
      h[i] = mod((long long)(p[i] - 'a') * cur),
      cur = mod((long long)cur * BASE);
    for (int i = (1); i < (sz); ++i) h[i] = mod(h[i - 1] + h[i]);
    memset((ok), 0, sizeof((ok)));
    for (int i = 0; i < (sz); ++i) {
      int rm = sz - i;
      int foo = mod((long long)mod(h[sz - 1] - h[sz - 1 - rm]) * p26[sz - rm]);
      int bar = h[rm - 1];
      if (foo == bar) ok[i] = 1;
    }
    for (int i = 0; i < (m); ++i) {
      cin >> y[i];
      y[i]--;
    }
    memset((used), 0, sizeof((used)));
    cur = 0;
    bool bad = false;
    while (cur < m) {
      for (int i = 0; i < (sz); ++i) {
        used[y[cur] + i] = 1;
        if (cur < m - 1 && y[cur + 1] == y[cur] + i) {
          if (!ok[i]) {
            bad = true;
          }
          break;
        }
      }
      cur++;
      if (bad) break;
    }
    int cntunused = 0;
    for (int i = 0; i < (n); ++i)
      if (!used[i]) cntunused++;
    printf("%d\n", bad ? 0 : p26[cntunused]);
  }
  return 0;
}
