#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
const double EPS = 1e-6;
const int INF = ~(1 << 31);
const long long LINF = ~(1LL << 63);
int string_to_int(string s) {
  int ten = 1, res = 0;
  for (int i = s.size() - 1; i >= 0; i--) {
    res += (s[i] - '0') * ten;
    ten *= 10;
  }
  return res;
}
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 main() {
  ios_base::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  string p;
  cin >> p;
  vector<int> zz = z_function(p);
  int len = p.size();
  vector<int> flag(n + 1, 0);
  vector<int> y(m);
  for (int i = 0; i < m; i++) {
    cin >> y[i];
    y[i]--;
    flag[y[i]]++;
    flag[y[i] + len]--;
  }
  for (int i = 1; i < m; i++) {
    int diff = y[i - 1] + len - y[i];
    if (diff > 0) {
      if (zz[len - diff] < diff) {
        cout << 0 << endl;
        return 0;
      }
    }
  }
  long long ans = 1LL;
  for (int i = 0; i < n; i++) {
    if (i) flag[i] += flag[i - 1];
    if (flag[i] == 0) {
      ans = (ans * 26LL) % 1000000007LL;
    }
  }
  cout << ans << endl;
  return 0;
}
