#include <bits/stdc++.h>
using namespace std;
const int MX = 1e6 + 5;
long long expo(int x, int n, int md) {
  if (n == 0) return 1;
  long long ans = expo(x, n / 2, md);
  ans %= md;
  ans *= ans;
  ans %= md;
  if (n % 2) ans *= x;
  ans %= md;
  return ans;
}
string h;
pair<long long, long long> hashy1[MX], hashy2[MX];
int n, k;
char bb[MX];
int vis[MX];
const int MD = 1e9 + 7;
int main() {
  cin >> n >> k;
  scanf("%s", bb);
  h = bb;
  long long b1 = 1013, b2 = 6969;
  hashy1[0].first = hashy1[0].second = h[0];
  for (int i = 1; i < h.size(); i++) {
    hashy1[i].first = (hashy1[i - 1].first + b1 * h[i]) % MD;
    b1 *= 1013;
    b1 %= MD;
    hashy1[i].second = (hashy1[i - 1].second + b2 * h[i]) % MD;
    b2 *= 6969;
    b2 %= MD;
  }
  reverse(h.begin(), h.end());
  b1 = 1013, b2 = 6969;
  hashy2[0].first = hashy2[0].second = h[0];
  for (int i = 1; i < h.size(); i++) {
    hashy2[i].first = (b1 * hashy2[i - 1].first + h[i]) % MD;
    hashy2[i].second = (b2 * hashy2[i - 1].second + h[i]) % MD;
  }
  int lx, x, len = (int)h.size();
  if (!k) {
    cout << expo(26, n, MD);
    return 0;
  }
  vector<int> vr;
  cin >> lx;
  vr.push_back(lx);
  vis[lx - 1]++;
  vis[lx + len - 1]--;
  for (int i = 1; i < k; i++) {
    cin >> x;
    vr.push_back(x);
    vis[x - 1]++;
    vis[x - 1 + len]--;
    int r = lx + len - x - 1;
    lx = x;
    if (r >= 0) {
      if (hashy1[r].first == hashy2[r].first &&
          hashy1[r].second == hashy2[r].second)
        continue;
      cout << 0;
      return 0;
    }
  }
  int z = 0, piq = n, i = 0;
  for (auto u : vr)
    for (i = max(u - 1, i); i < u - 1 + len; i++) piq--;
  cout << expo(26, piq, MD);
  return 0;
}
