#include <bits/stdc++.h>
using namespace std;
const int INF = INT_MAX;
const long long LINF = LLONG_MAX;
const unsigned long long ULINF = ULLONG_MAX;
const double EPS = 0.000001;
vector<char> str(1000000, '0');
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  string s;
  cin >> s;
  vector<char> beg(n, false);
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    x--;
    beg[x] = true;
  }
  bool canbe = true;
  int index = 0;
  int place = 0;
  while (index < n) {
    if (beg[index]) {
      int ip = 0;
      beg[index] = false;
      while (ip < s.length() && ip + index < n) {
        str[index + ip] = s[ip];
        if (beg[ip + index])
          if (str[index + ip] != s[0]) {
            canbe = false;
            break;
          } else {
            beg[ip + index] = false;
            index = ip + index;
            ip = 0;
          }
        ip++;
      }
      index += ip;
      if (!canbe) break;
    } else {
      index++;
    }
  }
  for (int i = 0; i < n; i++)
    if (str[i] == '0') place++;
  if (!canbe) {
    cout << 0 << "\n";
  } else if (place == 0)
    cout << 1 << "\n";
  else {
    long long ans = 1;
    for (int i = 0; i < place; i++) ans = (ans * 26) % 1000000007;
    cout << ans << "\n";
  }
  return 0;
}
