#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long int LINF = 0x3f3f3f3f3f3f3f3fll;
const long double pi = acos(-1);
const int MOD = 1e9 + 7;
const int N = 10000010;
int n, m;
int resp[N];
bool azedou = false;
long long int pref[N];
long long int el[N];
const long long int M = 2000003293;
const long long int B = 31;
void poe(int inicio, string &s) {
  int idx = inicio;
  for (int i = 0; i < s.size(); i++) {
    if (resp[i + inicio] == -1)
      resp[i + inicio] = i;
    else {
      long long int h1 = pref[s.size() - i];
      long long int h2 = (pref[s.size()] - pref[i] * el[s.size() - i]) % M;
      h2 += M;
      h2 %= M;
      if (h1 != h2) {
        azedou = true;
      }
      break;
    }
  }
}
long long int int_mod(long long int a, long long int b) {
  return (a % b + b) % b;
}
long long int eleva(long long int a, long long int b, long long int mod) {
  if (b == 0)
    return 1;
  else if (b == 1)
    return a;
  long long int x = eleva(a, b / 2, mod);
  if (b % 2 == 0)
    return (x * x) % mod;
  else
    return (a * ((x * x) % mod)) % mod;
}
void Rabin_karp(string &pattern) {
  int n = pattern.size();
  long long int hp = 0;
  for (int i = 0; i < n; i++) {
    hp = int_mod(hp * B + pattern[i], M);
    pref[i + 1] = hp;
  }
  for (int i = 0; i < n; i++) {
    el[i] = eleva(B, i, M);
  }
}
int main() {
  ios::sync_with_stdio(false);
  ;
  string s;
  memset(resp, -1, sizeof(resp));
  cin >> n >> m >> s;
  vector<int> v;
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    v.push_back(x);
  }
  Rabin_karp(s);
  reverse(v.begin(), v.end());
  for (int i = 0; i < m; i++) {
    poe(v[i], s);
  }
  long long int r = 1;
  for (int i = 1; i <= n; i++) {
    if (resp[i] == -1) r = (r * 26ll) % MOD;
  }
  if (azedou)
    cout << 0 << endl;
  else
    cout << r << endl;
  return 0;
}
