#include <bits/stdc++.h>
using namespace std;
vector<int> zAlgorithm(string &s) {
  int n = s.length();
  vector<int> z(n);
  z[0] = n;
  int l = -1, r = -1;
  for (int i = 1; i < n; i++) {
    if (r <= i) {
      l = i;
      r = i;
      while (s[r] == s[r - l] && r < n) r++;
      z[i] = r - l;
    } else {
      z[i] = z[i - l];
      if (z[i] >= r - i) {
        l = i;
        while (s[r] == s[r - l] && r < n) r++;
        z[i] = r - l;
      }
    }
  }
  return z;
}
const int MOD = 1000000007;
long long fastPower(long long b, long long e) {
  long long res = 1;
  while (e) {
    if (e & 1) res *= b, res %= MOD;
    b *= b, b %= MOD;
    e >>= 1;
  }
  return res;
}
long long pow26(long long e) { return fastPower(26, e); }
int main() {
  int n, m;
  cin >> n >> m;
  if (m == 0) {
    cout << pow26(n) << endl;
    return 0;
  }
  string s;
  cin >> s;
  vector<int> z = zAlgorithm(s);
  long long y, y2, res = 1, p = s.length();
  cin >> y;
  res *= pow26(y - 1);
  res %= MOD;
  for (int k = 2; k <= m; k++) {
    cin >> y2;
    if (y2 - y < p && z[y2 - y] < p - (y2 - y)) {
      cout << 0 << endl;
      return 0;
    }
    res *= pow26(max(0LL, y2 - y - p));
    res %= MOD;
    y = y2;
  }
  y2 = n + 1;
  res *= pow26(max(0LL, y2 - y - p));
  res %= MOD;
  cout << res << endl;
  return 0;
}
