#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int mod = 1e9 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  string s;
  cin >> s;
  vector<char> v(n, '@');
  vector<int> u(m);
  for (int &e : u) cin >> e;
  int l = 0;
  int x = s.size();
  ll ans = 1;
  for (int i = 0; i < n; i++) {
    if (l < m && u[l] - 1 == i) {
      l++;
      x = 0;
    }
    if (x < (int)s.size()) v[i] = s[x];
    x++;
    if (v[i] == '@') ans = (ans * 26) % mod;
  }
  vector<char> t;
  for (char i : s) t.push_back(i);
  t.push_back('#');
  for (char i : v) t.push_back(i);
  vector<int> kmp(t.size());
  for (int i = 1; i < (int)t.size(); i++) {
    int j = kmp[i - 1] - 1;
    while (j >= 0 && t[j + 1] != t[i]) {
      j = kmp[j] - 1;
    }
    if (j >= 0)
      kmp[i] = j + 2;
    else
      kmp[i] = t[0] == t[i];
  }
  if (count(kmp.begin(), kmp.end(), s.size()) >= m)
    cout << ans;
  else
    cout << 0;
}
