#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int n, m, x, vis[1000006], ok[1000006];
string s;
int kmp[1000006];
int main() {
  cin >> n >> m;
  cin >> s;
  kmp[0] = 0;
  for (int i = 1; i < s.size(); i++) {
    int now = kmp[i - 1];
    while (true) {
      if (s[i] == s[now]) {
        kmp[i] = now + 1;
        break;
      } else {
        if (now == 0)
          break;
        else
          now = kmp[now - 1];
      }
    }
  }
  int l = s.size();
  int now = kmp[l - 1];
  while (true) {
    if (l - now < l) ok[l - now] = 1;
    if (now == 0) break;
    now = kmp[now - 1];
  }
  for (int i = 1; i <= m; i++) cin >> x, vis[x] = 1;
  int lt = -1, rt = -1;
  long long ans = 1;
  for (int i = 1; i <= n; i++) {
    if (vis[i] == 1) {
      if (rt < i)
        lt = i, rt = i + l - 1;
      else {
        int ds = i - lt;
        if (ok[ds] == 0)
          cout << 0 << endl, exit(0);
        else
          lt = i, rt = i + l - 1;
      }
    }
    if (i > rt) ans = (ans * 26LL) % mod;
  }
  cout << ans << endl;
}
