#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 2000000;
const long long mod = 1000000007;
long long mi[MAXN];
vector<long long> z;
void z_function(string &s) {
  long long L = 0ll, R = 0ll, n = s.length();
  z.assign(n, 0ll);
  for (long long i = 1ll; i < n; i++) {
    if (i <= R) z[i] = min(z[i - L], R - i + 1ll);
    while (i + z[i] < n && s[i + z[i]] == s[z[i]]) z[i]++;
    if (i + z[i] - 1ll > R) L = i, R = i + z[i] - 1ll;
  }
}
long long can(long long m) {
  long long sz = 0ll;
  long long pos = -1ll;
  for (long long i = 0ll; i < m; i++) {
    if (i > 0ll && mi[i] == mi[i - 1ll]) continue;
    if (pos == -1ll) {
      sz += z.size();
      pos = mi[i];
    } else {
      if (pos + z.size() - 1ll < mi[i]) {
        sz += z.size();
        pos = mi[i];
      } else if (z[mi[i] - pos] + (mi[i] - pos) != z.size())
        return -1ll;
      else
        sz += (mi[i] - pos);
      pos = mi[i];
    }
  }
  return sz;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n, m;
  cin >> n >> m;
  string p;
  cin >> p;
  for (long long i = 0ll; i <= m; i++) {
    cin >> mi[i];
    mi[i]--;
  }
  sort(mi, mi + m);
  z_function(p);
  long long sz = can(m);
  if (sz == -1ll) {
    cout << "0\n";
    return 0;
  }
  long long kk = n - sz;
  long long sol = 1ll;
  for (long long i = 1ll; i <= kk; i++) sol = (sol * 26ll) % mod;
  cout << sol << '\n';
  return 0;
}
