#include <bits/stdc++.h>
using namespace std;
int dp[1000005] = {0};
bool f[1000005] = {false};
int main() {
  ios::sync_with_stdio(false);
  int n, m;
  string s;
  cin >> n >> m >> s;
  int i = 0, len = s.length();
  for (int j = 1; j < len; j++) {
    if (s[j] == s[i]) {
      i++;
      dp[j] = i;
    } else {
      while (i > 0) {
        i = dp[i - 1];
        if (s[i] == s[j]) {
          dp[j] = i + 1;
          break;
        }
      }
    }
  }
  int p = dp[len - 1];
  while (p > 0) {
    f[p] = true;
    p = dp[p] - 1;
  }
  int x, pos = 0;
  long long ans = 1;
  for (int i = 0; i < m; i++) {
    cin >> x;
    x--;
    if (x < pos) {
      int q = pos - x;
      if (f[q] == false) {
        cout << 0 << endl;
        return 0;
      }
    }
    if (x > pos) {
      for (int j = pos; j < x; ++j) ans = ans * 26 % 1000000007;
    }
    pos = x + len;
  }
  for (; pos < n; pos++) ans = ans * 26 % 1000000007;
  cout << ans << endl;
  return 0;
}
