#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n1, m;
  cin >> n1 >> m;
  string s;
  cin >> s;
  long long n;
  n = s.size();
  long long lps[n];
  lps[0] = 0;
  long long i, j;
  if (m == 0) {
    long long ans3 = 1;
    for (i = 1; i <= n1; i++) {
      ans3 = (ans3 * 26) % 1000000007;
    }
    cout << ans3 << endl;
    return 0;
  }
  i = 0;
  i++;
  long long len = 0;
  j = 0;
  while (i < n) {
    if (s[i] == s[len]) {
      len++;
      lps[i] = len;
      i++;
    } else {
      if (len != 0) {
        len = lps[len - 1];
      } else {
        lps[i] = 0;
        i++;
      }
    }
  }
  vector<long long> v;
  for (i = 0; i < m; i++) {
    long long x;
    cin >> x;
    v.push_back(x);
  }
  if (s.size() == 1) {
    long long ans3 = 1;
    for (i = 1; i <= n1 - m; i++) {
      ans3 = (ans3 * 26) % 1000000007;
    }
    cout << ans3 << endl;
    return 0;
  }
  if (s.size() == 1 && m == 1) {
    cout << 1 << endl;
    return 0;
  }
  long long vis[n1];
  for (i = 0; i < n1; i++) {
    vis[i] = 0;
  }
  long long r;
  r = -1;
  for (i = 0; i < m; i++) {
    long long x;
    x = v[i];
    x--;
    if (x > r) {
      if (x + n - 1 >= n1) {
        cout << 0 << endl;
        return 0;
      }
      for (j = x; j < x + n; j++) {
        vis[j] = 1;
      }
      r = x + n - 1;
    } else {
      if (r + (n - (r - x + 1)) >= n1) {
        cout << 0 << endl;
        return 0;
      }
      for (j = r + 1; j <= r + (n - (r - x + 1)); j++) {
        vis[j] = 1;
      }
      r = r + (n - (r - x + 1));
    }
  }
  long long c = 0LL;
  for (i = 0; i < n1; i++) {
    if (vis[i] == 0) c++;
  }
  long long arr[c + 1];
  arr[0] = 1;
  for (i = 1; i <= c; i++) {
    arr[i] = (arr[i - 1] * 26) % 1000000007;
  }
  map<long long, long long> m1;
  long long k1;
  k1 = lps[n - 1];
  while (k1 > 0) {
    m1[n - k1] = 1;
    k1 = lps[k1 - 1];
  }
  if (m == 1) {
    cout << arr[c] << endl;
    return 0;
  }
  r = v[0] - 1;
  for (i = 1; i < m; i++) {
    long long x;
    x = v[i];
    x--;
    if (r + n - 1 < x) {
      r = x;
    } else {
      long long pos;
      pos = x - r;
      if (m1.find(pos) == m1.end()) {
        cout << 0 << endl;
        return 0;
      } else
        r = x;
    }
  }
  cout << arr[c] << endl;
  return 0;
}
