#include <bits/stdc++.h>
using namespace std;
long long n, m, l, x, e = -1, t = 1;
string p;
int main() {
  cin >> n >> m >> p;
  l = p.length();
  while (m--) {
    scanf("%d", &x);
    if (x - e >= l || e == -1)
      n -= l;
    else {
      if (p[x - e] != p[0]) {
        cout << "0";
        return 0;
      } else
        n -= x - e;
    }
    e = x;
  }
  while (n--) t = (t * 26) % 1000000007;
  cout << t;
  return 0;
}
