#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void smin(T &a, U b) {
  if (a > b) a = b;
}
template <typename T, typename U>
inline void smax(T &a, U b) {
  if (a < b) a = b;
}
template <class T>
inline void gn(T &first) {
  char c, sg = 0;
  while (c = getchar(), (c > '9' || c < '0') && c != '-')
    ;
  for ((c == '-' ? sg = 1, c = getchar() : 0), first = 0; c >= '0' && c <= '9';
       c = getchar())
    first = (first << 1) + (first << 3) + c - '0';
  if (sg) first = -first;
}
template <class T, class T1>
inline void gn(T &first, T1 &second) {
  gn(first);
  gn(second);
}
template <class T, class T1, class T2>
inline void gn(T &first, T1 &second, T2 &z) {
  gn(first);
  gn(second);
  gn(z);
}
template <class T>
inline void print(T first) {
  if (first < 0) {
    putchar('-');
    return print(-first);
  }
  if (first < 10) {
    putchar('0' + first);
    return;
  }
  print(first / 10);
  putchar(first % 10 + '0');
}
template <class T>
inline void printsp(T first) {
  print(first);
  putchar(' ');
}
template <class T>
inline void println(T first) {
  print(first);
  putchar('\n');
}
int power(int a, int b, int m, int ans = 1) {
  for (; b; b >>= 1, a = 1LL * a * a % m)
    if (b & 1) ans = 1LL * ans * a % m;
  return ans;
}
char str[2000100];
int pos[2000100], cnt[2000100];
int p[2000100], q[2000100];
int main() {
  int n, k;
  cin >> n >> k;
  scanf("%s", str + 1);
  int len = strlen(str + 1);
  for (int i = 1; i <= len; i++)
    p[i] = (p[i - 1] * 29LL + str[i] - 'a' + 1) % 1000000007;
  long long pp = 1;
  for (int i = len; i; i--) {
    int l = len - i + 1;
    q[l] = (q[l - 1] + pp * (str[i] - 'a' + 1)) % 1000000007;
    pp = pp * 29 % 1000000007;
  }
  for (int i = 0; i < k; i++) gn(pos[i]), cnt[pos[i]]++, cnt[pos[i] + len]--;
  for (int i = 0; i < k - 1; i++) {
    int l = pos[i] + len - pos[i + 1];
    if (l <= 0) continue;
    if (p[l] != q[l]) {
      puts("0");
      return 0;
    }
  }
  int nn = 0;
  for (int i = 1; i <= n; i++) {
    cnt[i] += cnt[i - 1];
    if (cnt[i] == 0) nn++;
  }
  printf("%d\n", power(26, nn, 1000000007));
  return 0;
}
