#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000100;
const long long mod = 1000000007;
long long v[MAXN];
long long z[MAXN];
long long n, m;
string s;
long long pot[MAXN];
void zf() {
  long long l = 0, r = 0;
  long long t = s.size();
  for (long long i = 1; i < s.size(); i++) {
    if (i > r) {
      r = l = i;
      while (r < t && s[r - l] == s[r]) r++;
      z[i] = r - l;
      r--;
      continue;
    }
    long long k = i - l;
    if (z[k] <= r - i)
      z[i] = z[k];
    else {
      l = i;
      while (r < t && s[r - l] == s[r]) r++;
      z[i] = r - l;
      r--;
    }
  }
}
bool mark[MAXN];
signed main() {
  cin >> n >> m;
  cin >> s;
  zf();
  long long t = s.size();
  long long p = 1;
  for (long long i = 0; i <= n; i++) {
    pot[i] = p;
    p *= 26, p %= mod;
  }
  bool f = true;
  long long last = -1;
  for (long long i = 1; i <= m; i++) {
    long long x;
    cin >> x;
    if (i == 1) {
      for (long long j = x; j < x + t; j++) mark[j] = true;
    } else {
      if (x > last + t - 1)
        for (long long j = x; j < x + t; j++) mark[j] = true;
      else {
        long long k = x - last;
        if (z[k] != t - k) {
          cout << 0 << endl;
          return 0;
        } else
          for (long long j = last + t; j < x + t; j++) mark[j] = true;
      }
    }
    last = x;
  }
  long long cnt = 0;
  for (long long i = 1; i <= n; i++)
    if (mark[i] == false) cnt++;
  cout << pot[cnt] << endl;
}
