#include <bits/stdc++.h>
using namespace std;
string x, s;
long long n, m, ans = 1, Mod = 1000000007;
bool ind[1000005];
int main() {
  cin >> n >> m >> x;
  for (int i = 0; i < m; i++) {
    int temp;
    cin >> temp;
    ind[--temp] = 1;
  }
  vector<int> lps(x.size() + 1);
  int st = x.size();
  while (s.size() < n) {
    if (ind[s.size()]) {
      st = 0;
    }
    if (st < x.size())
      s += x[st++];
    else
      s += ".", ans = (ans * 26) % Mod;
  }
  lps[0] = -1;
  for (int i = 0, j = -1; i < x.size();) {
    while (j >= 0 && x[i] != x[j]) j = lps[j];
    i++, j++;
    lps[i] = j;
  }
  for (int i = 0, j = 0; i < s.size();) {
    while (j >= 0 && s[i] != x[j]) j = lps[j];
    i++, j++;
    if (j == x.size()) m--, j = lps[j];
  }
  m <= 0 ? cout << ans : cout << 0;
  return 0;
}
