#include <bits/stdc++.h>
using namespace std;
int n, m, z[1000010], seq[1000010];
string p;
void b();
int main() {
  cin >> n >> m >> p;
  b();
  for (int i = 0; i < m; i++) {
    cin >> seq[i];
  }
  bool possible = true;
  for (int i = 0; i < m - 1; i++) {
    if (seq[i] + p.size() - 1 >= seq[i + 1] &&
        z[seq[i + 1] - seq[i]] + seq[i + 1] != seq[i] + p.size()) {
      possible = false;
      break;
    }
  }
  if (!possible) {
    cout << 0 << endl;
  } else {
    int covered = 0, maxR = 0;
    for (int i = 0; i < m; i++) {
      covered += seq[i] + p.size() - max(maxR, seq[i]);
      maxR = seq[i] + p.size();
    }
    long long int res = 1;
    covered = n - covered;
    while (covered) {
      res *= 26;
      res %= 1000000007;
      covered--;
    }
    cout << res << endl;
  }
  return 0;
}
void b() {
  int l = 0, r = -1;
  z[0] = p.size();
  for (int i = 1; i < p.size(); i++) {
    if (i > r) {
      int aux = i;
      while (aux < p.size() && p[aux] == p[aux - i]) aux++;
      z[i] = aux - i;
      if (aux > i) {
        l = i;
        r = aux - 1;
      }
    } else {
      int t = i - l;
      if (z[t] < r - i + 1) {
        z[i] = z[t];
      } else {
        int aux = r + 1;
        while (aux < p.size() && p[aux] == p[aux - i]) aux++;
        z[i] = aux - i;
        l = i;
        r = aux - 1;
      }
    }
  }
  return;
}
