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