#include <bits/stdc++.h>
using namespace std;
const int md = 1000000007;
char s[1234567];
int z[1234567];
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  scanf("%s", s);
  int len = strlen(s);
  int l = 0, r = 0;
  for (int i = 1; i < len; ++i) {
    if (i > r) {
      l = r = i;
      while (r < len && s[r - l] == s[r]) {
        ++r;
      }
      z[i] = r - l;
      --r;
    } else {
      if (z[i - l] < r - i + 1) {
        z[i] = z[i - l];
      } else {
        l = i;
        while (r < len && s[r - l] == s[r]) {
          ++r;
        }
        z[i] = r - l;
        --r;
      }
    }
  }
  bool bad = false;
  int prev = -1;
  int any = 0;
  for (int i = 0; i < m; ++i) {
    int foo;
    scanf("%d", &foo);
    --foo;
    if (prev == -1) {
      any += foo;
    } else {
      if (prev + len - 1 >= foo) {
        if (z[foo - prev] != prev + len - foo) {
          bad = true;
        }
      } else {
        any += foo - prev - len;
      }
    }
    prev = foo;
  }
  if (m > 0)
    any += n - prev - len;
  else
    any = n;
  if (bad)
    puts("0");
  else {
    int ans = 1;
    while (any--) {
      ans = ans * 26LL % md;
    }
    printf("%d\n", ans);
  }
  return 0;
}
