#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
vector<int> z_function(string s) {
  int n = (int)s.length();
  vector<int> z(n);
  for (int i = 1, l = 0, r = 0; i < n; ++i) {
    if (i <= r) z[i] = min(r - i + 1, z[i - l]);
    while (i + z[i] < n && s[z[i]] == s[i + z[i]]) ++z[i];
    if (i + z[i] - 1 > r) l = i, r = i + z[i] - 1;
  }
  return z;
}
int n, m;
string s;
bool z[2000005];
int pos;
int c[2000005];
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  cin >> s;
  vector<int> F = z_function(s);
  for (int i = 1; i < s.size(); ++i) {
    if (F[i] == s.size() - i) z[i + 1] = true;
  }
  for (int i = 0; i < m; ++i) {
    cin >> pos;
    pos--;
    c[pos] = 1;
  }
  int cur = -1;
  long long ans = 1;
  for (int i = 0; i < n; ++i) {
    if (c[i] == 0) {
      if (cur != -1) {
        cur++;
        if (cur > s.size()) cur = -1;
      }
      if (cur == -1) ans = ans * 26 % mod;
    } else {
      if (cur == s.size())
        cur = -1;
      else {
        if (cur != -1) cur++;
      }
      if (cur == -1) {
        cur = 1;
      } else {
        if (!z[cur]) ans = 0;
        cur = 1;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
