#include <bits/stdc++.h>
using namespace std;
long long N, M;
string str;
long long Z[1234567];
bool allowed[1234567];
long long len;
long long power(long long a, long long b, long long c) {
  long long ans = 1;
  while (b != 0) {
    if (b % 2 == 1) ans = (ans * a) % c;
    a = (a * a) % c;
    b /= 2;
  }
  return ans;
}
void Z_fun() {
  long long i, j;
  long long L = 0;
  long long R = 0;
  Z[0] = 0;
  for (i = 1; i < len; i++) {
    Z[i] = 0;
    if (i <= R) Z[i] = min(Z[i - L], R - i + 1);
    while (i + Z[i] < len) {
      if (str[Z[i]] == str[Z[i] + i])
        Z[i]++;
      else
        break;
    }
    if (i + Z[i] - 1 > R) {
      R = i + Z[i] - 1;
      L = i;
    }
  }
  for (i = 1; i < len; i++) {
    if (i + Z[i] == len) allowed[i] = 1;
  }
}
int main() {
  scanf("%lld%lld", &N, &M);
  cin >> str;
  len = str.size();
  memset(allowed, 0, sizeof allowed);
  Z_fun();
  long long empty = 0;
  if (M == 0)
    empty = N;
  else {
    long long i, j;
    long long X;
    scanf("%lld", &X);
    X--;
    empty += X;
    long long prev = X;
    for (i = 1; i < M; i++) {
      scanf("%lld", &X);
      X--;
      if (X - prev >= len)
        empty += X - (prev + len);
      else if (allowed[X - prev] == 0) {
        printf("0");
        return 0;
      }
      prev = X;
    }
    empty += N - (X + len);
  }
  long long ans = power(26, empty, 1000000007);
  printf("%lld", ans);
  return 0;
}
