#include <bits/stdc++.h>
using namespace std;
long long poww(long long a, long long b) {
  long long m = b, ans = 1, temp;
  while (b > 0) {
    long long n = b % 2;
    if (b == m) {
      temp = a % 1000000007;
    } else
      temp = (temp * temp) % 1000000007;
    if (n == 1) ans = (ans * temp) % 1000000007;
    b = b / 2;
  }
  return ans;
}
int main() {
  long long i, j, k, l, n, t, m, ans = 0, temp = 0, p, q;
  string s;
  cin >> t >> m;
  char fin[t + 2];
  for (i = 0; i <= t + 1; i++) fin[i] = '0';
  cin >> s;
  s = '*' + s;
  n = s.size();
  n--;
  long long a[n + 1];
  memset(a, 0, sizeof(a));
  a[1] = 1;
  j = 1;
  for (i = 2; i <= n; i++) {
    if (s[i] == s[j]) {
      j++;
      a[i] = j;
    } else {
      while (j > 1 && s[i] != s[j]) {
        j = a[j - 1];
      }
      if (s[i] == s[j]) {
        j++;
        a[i] = j;
      } else
        a[i] = 1;
    }
  }
  for (i = 1; i <= n; i++) --a[i];
  temp = a[n];
  while (m--) {
    long long no;
    cin >> no;
    j = no;
    if (fin[no] == '0') {
      k = no;
      i = 1;
      while (i <= n) {
        fin[k++] = s[i++];
      }
    } else {
      if (fin[no] != s[1]) {
        cout << 0;
        return 0;
      } else {
        p = k - j;
        if (p > temp) {
          cout << 0;
          return 0;
        } else {
          p++;
          while (p <= n) {
            fin[k++] = s[p++];
          }
        }
      }
    }
  }
  for (i = 1; i <= t; i++) {
    if (fin[i] == '0') ans++;
  }
  ans = poww(26, ans);
  cout << ans;
  return 0;
}
