#include <bits/stdc++.h>
using namespace std;
const int cmx = 1e6 + 6;
char buf[cmx];
string s;
int n, m, len;
int z[cmx], pos[cmx];
vector<int> v;
int main() {
  cin >> n >> m;
  scanf("%s", buf);
  s = buf;
  len = s.size();
  for (int i = 0; i < m; i++) {
    int x;
    scanf("%d", &x);
    x--;
    v.push_back(x);
    pos[x]++;
    pos[x + len]--;
  }
  for (int i = 1; i <= n; i++) pos[i] += pos[i - 1];
  z[0] = len;
  int l = 0, r = 0;
  for (int i = 1; i < len; i++) {
    if (r < i) {
      l = r = i;
      while (r < n and s[r - l] == s[r]) r++;
      z[i] = r - l;
      r--;
    } else {
      int k = i - l;
      if (z[k] < r - l + 1)
        z[i] = z[k];
      else {
        l = i;
        while (r < n and s[r - l] == s[r]) r++;
        z[i] = r - l;
        r--;
      }
    }
  }
  for (int i = 1; i < v.size(); i++) {
    if (v[i] < v[i - 1] + len) {
      int k = v[i - 1] + len - v[i];
      int idx = len - k;
      if (z[idx] < k) {
        cout << 0 << '\n';
        return 0;
      }
    }
  }
  long long ans = 1;
  for (int i = 0; i < n; i++)
    if (pos[i] == 0) ans = 1ll * ans * 26 % 1000000007ll;
  cout << ans << '\n';
  return 0;
}
