#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int maxn = 1111111;
const int INF = 1 << 30;
const int logN = 18;
int n, m;
char s[maxn];
int p[maxn];
int z[maxn];
bool f[maxn];
int main(int argc, char const *argv[]) {
  scanf("%d%d", &(n), &(m));
  scanf("%s", (s));
  for (int(i) = 0; i < (int)(m); ++(i)) {
    scanf("%d", &(p[i]));
    p[i]--;
  }
  int len = strlen(s);
  int L = 0, R = 0;
  for (int i = 1; i < len; i++) {
    if (i > R) {
      L = R = i;
      while (R < n && s[R - L] == s[R]) R++;
      z[i] = R - L;
      R--;
    } else {
      int k = i - L;
      if (z[k] < R - i + 1)
        z[i] = z[k];
      else {
        L = i;
        while (R < n && s[R - L] == s[R]) R++;
        z[i] = R - L;
        R--;
      }
    }
  }
  bool valid = 1;
  for (int i = 0; i < m && valid; ++i) {
    if (i == 0 || p[i] - p[i - 1] > len) {
      for (int j = p[i]; j < p[i] + len; ++j) f[j] = 1;
    } else {
      int df = p[i] - p[i - 1];
      if (z[df] != len - df)
        valid = 0;
      else {
        for (int j = p[i] + len - df; j < p[i] + len; ++j) f[j] = 1;
      }
    }
  }
  if (valid) {
    long long ans = 1;
    for (int i = 0; i < n; ++i)
      if (!f[i]) {
        ans = (ans * 26) % MOD;
      }
    cout << (ans) << endl;
  } else {
    puts("0");
  }
  return 0;
}
