#include <bits/stdc++.h>
using namespace std;
char p[1000001];
int main() {
  int n, m, y1 = -1, y2;
  scanf("%d %d", &n, &m);
  scanf("%s", p);
  int plen = strlen(p);
  for (int i = 0; i < m; ++i) {
    scanf("%d", &y2);
    if (-1 == y1) {
      n -= plen;
    } else if (y2 - y1 < plen) {
      if (p[y2 - y1] != p[0]) {
        cout << 0;
        return 0;
      }
      n -= y2 - y1;
    } else {
      n -= plen;
    }
    y1 = y2;
  }
  long long ans = 1;
  for (int i = 0; i < n; ++i) {
    ans = ans * 26 % 1000000007;
  }
  cout << ans << endl;
  return 0;
}
