#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline int sz(const T& x) {
  return (int)x.size();
}
template <typename T>
inline void mn(T& x, const T& y) {
  if (y < x) x = y;
}
template <typename T>
inline void mx(T& x, const T& y) {
  if (x < y) x = y;
}
char p[1000010];
int n, m;
int len;
int x[1000010];
int z[1000010];
void z_function() {
  for (int i = 1, l = 0, r = 0; i < len; ++i) {
    if (i <= r) z[i] = min(r - i + 1, z[i - l]);
    while (i + z[i] < len && p[z[i]] == p[i + z[i]]) z[i]++;
    if (i + z[i] - 1 > r) l = i, r = i + z[i] - 1;
  }
}
int covered[1000001];
int main() {
  scanf("%d%d\n", &n, &m);
  scanf("%s", p);
  len = strlen(p);
  for (int i = 0; i < (m); ++i) {
    scanf("%d", &x[i]);
    x[i]--;
    covered[x[i]]++;
    covered[x[i] + len]--;
  }
  z_function();
  for (int i = 1; i < m; ++i) {
    int shift = x[i] - x[i - 1];
    if (shift < len) {
      if (z[shift] < len - shift) {
        printf("0\n");
        return 0;
      }
    }
  }
  long long ways = 1;
  for (int i = 0, sum = 0; i < n; ++i) {
    sum += covered[i];
    if (sum == 0) {
      ways *= 26;
      ways %= 1000000007;
    }
  }
  printf("%d\n", (int)(ways));
  return 0;
}
