#include <bits/stdc++.h>
using namespace std;
const int N = 1000010;
const int md = 1e9 + 7;
int mul(int a, int b) { return (long long)a * b % md; }
char s[N];
int n, m, nn, x[N], z[N];
bool start[N];
int main() {
  scanf("%d %d %s", &n, &m, s);
  nn = strlen(s);
  for (int i = 0; i < m; i++) {
    scanf("%d", &x[i]);
    x[i]--;
    start[x[i]] = true;
  }
  for (int i = 1, l = -1, r = -1; i < nn; i++) {
    int &k = z[i];
    if (i < r) {
      k = min(r - i, z[i - l]);
    }
    for (; i + k < nn && s[k] == s[i + k]; k++)
      ;
    if (i + k > r) {
      l = i;
      r = i + k;
    }
  }
  for (int i = 0; i < m - 1; i++) {
    int p = x[i + 1] - x[i];
    if (p + z[p] < nn) {
      puts("0");
      return 0;
    }
  }
  int ans = 1;
  int r = -1;
  for (int i = 0; i < n; i++) {
    if (start[i]) {
      r = i + nn;
    }
    if (i >= r) {
      ans = mul(ans, 26);
    }
  }
  printf("%d\n", ans);
  return 0;
}
