#include <bits/stdc++.h>
using namespace std;
string s;
string ans;
int n, m;
set<int> sou;
int z[2000006];
string b, a;
void calc() {
  memset(z, 0, sizeof(z));
  int l = 0, r = 0;
  int len = s.size();
  for (int i = 1; i < len; i++) {
    if (i > r) {
      l = r = i;
      while (r < len && s[r] == s[r - l]) r++;
      z[i] = r - l;
      r--;
    } else {
      if (z[i - l] < r - i + 1)
        z[i] = z[i - l];
      else {
        l = i;
        while (r < len && s[r] == s[r - l]) r++;
        z[i] = r - l;
        r--;
      }
    }
  }
}
bool f() {
  int len = s.size();
  s += '$';
  s += ans;
  int slen = s.size();
  calc();
  int ans = 0;
  for (int i = len + 2, j = 1; i < slen; i++, j++)
    if (z[i] == len) {
      if (sou.find(j) != sou.end()) sou.erase(j);
    }
  if (!sou.size()) return 1;
  return 0;
}
void bfs() {
  queue<pair<int, int> > q;
  int inp;
  while (m--) {
    scanf("%d", &inp);
    sou.insert(inp);
    q.push(make_pair(inp, 0));
  }
  while (!q.empty()) {
    pair<int, int> u = q.front();
    q.pop();
    ans[u.first] = s[u.second];
    if (u.second + 1 < s.size() && u.first + 1 < ans.size() &&
        ans[u.first + 1] == '?')
      q.push(make_pair(u.first + 1, u.second + 1));
  }
}
int main() {
  scanf("%d %d", &n, &m);
  ans += '?';
  for (int i = 0; i < n; i++) ans += '?';
  cin >> s;
  bfs();
  if (!f()) {
    cout << 0 << '\n';
  } else {
    long long int ret = 1;
    for (int i = 1; i < ans.size(); i++)
      if (ans[i] == '?') {
        ret *= 26;
        ret %= 1000000007;
      }
    cout << ret << '\n';
  }
  return 0;
}
