#include <bits/stdc++.h>
using namespace std;
char Str[1000005], T[1000005];
long long Mod = 1000000007;
bool Marked[1000005];
int KMP[1000005];
set<int> S;
set<int>::iterator it;
long long Power(int base, int expo) {
  if (expo == 0)
    return 1;
  else {
    long long x = Power(base, expo >> 1);
    if (expo & 1)
      return (((x * x) % Mod) * base) % Mod;
    else
      return (x * x) % Mod;
  }
}
void Algo_KMP(int length) {
  int i, j;
  KMP[1] = 1;
  for (i = 2; i <= length; ++i) {
    j = KMP[i - 1];
    while (true) {
      if (T[j] != T[i]) {
        if (j == 1) {
          KMP[i] = 1;
          break;
        } else
          j = KMP[j - 1];
      } else {
        KMP[i] = j + 1;
        break;
      }
    }
  }
}
long long query(int N, int length) {
  int i, j;
  for (i = 1, j = 1; i <= N;) {
    if (Str[i] != T[j]) {
      if (j == 1)
        ++i;
      else
        j = KMP[j - 1];
    } else {
      if (j == length) {
        S.insert(i - length + 1);
        ++i;
        j = KMP[j];
      } else {
        ++i;
        ++j;
      }
    }
  }
  int Count = 0;
  for (i = 1; i <= N; ++i) {
    if (Marked[i] == true) {
      it = S.find(i);
      if (it == S.end()) return 0;
    }
    if (Str[i] == '@') ++Count;
  }
  return Power(26, Count);
}
int main() {
  int N, m, i, k, Num;
  scanf("%d%d%s", &N, &m, T + 1);
  for (i = 1; i <= m; ++i) {
    scanf("%d", &Num);
    Marked[Num] = true;
  }
  if (m == 0) {
    printf("%lld\n", Power(26, N));
    return 0;
  }
  int Cur = 1, length = strlen(T + 1);
  for (i = 1; i <= N; ++i) {
    if (Marked[i] == false) continue;
    if (Cur < i) {
      Cur = i;
      k = 1;
    } else
      k = Cur - i + 1;
    for (; k <= length; ++k, ++Cur) Str[Cur] = T[k];
  }
  for (i = 1; i <= N; ++i) {
    if (!(Str[i] >= 'a' && Str[i] <= 'z')) Str[i] = '@';
  }
  Str[N + 1] = '\0';
  Algo_KMP(length);
  printf("%lld\n", query(N, length));
  return 0;
}
