#include <bits/stdc++.h>
using namespace std;
const long long INF = (long long)1e9;
vector<long long> substr(string& s) {
  vector<long long> z(s.size());
  long long l = 0, r = 0;
  for (long long i = 1; i < s.size(); i++) {
    if (i <= r) z[i] = min(r - i + 1, z[i - l]);
    while (i + z[i] < s.size() && s[z[i]] == s[i + z[i]]) z[i]++;
    if (i + z[i] - 1 > r) l = i, r = z[i] + i - 1;
  }
  return z;
}
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  long long n, m;
  cin >> n >> m;
  string s;
  cin >> s;
  vector<long long> z = substr(s), xs;
  if (m > 0) {
    long long s_x;
    cin >> s_x;
    xs.push_back(s_x);
    for (long long i = 1; i < m; i++) {
      long long x;
      cin >> x;
      long long d = x - s_x;
      if (d < s.size()) {
        if (z[d] < s.size() - d) {
          cout << 0;
          return 0;
        }
      }
      xs.push_back(x);
      s_x = x;
    }
  }
  long long used = 0;
  long long t = 0;
  for (auto x : xs) {
    long long plus = min(1LL * s.size(), x + s.size() - 1 - t);
    used += plus;
    t = x + s.size() - 1;
  }
  long long sum = 1;
  for (long long i = used; i < n; i++) {
    sum = (sum * 26) % ((long long)1e9 + 7);
  }
  cout << sum;
}
