#include <bits/stdc++.h>
using namespace std;
int mini(int a, int b) { return a < b ? a : b; }
long long lmini(long long a, long long b) { return a < b ? a : b; }
int maxi(int a, int b) { return a > b ? a : b; }
long long lmaxi(long long a, long long b) { return a > b ? a : b; }
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lgcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int lcm(int a, int b) { return a * (b / gcd(a, b)); }
long long llcm(long long a, long long b) { return a * (b / gcd(a, b)); }
string c;
long long n, lps[1000005], x, a[1000005], m;
void cal() {
  long long i = 1, len = 0;
  lps[0] = 0;
  while (i < n) {
    if (c[i] == c[len]) {
      len++;
      lps[i] = len;
      i++;
    } else {
      if (len != 0)
        len = lps[len - 1];
      else {
        lps[i] = 0;
        i++;
      }
    }
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> m >> x;
  cin >> c;
  n = c.size();
  cal();
  long long i, z = n - lps[n - 1], d = 0, l;
  if (x >= 1) {
    for (i = 1; i <= x; i++) {
      cin >> a[i];
      a[i] -= 1;
    }
    if (x >= 1) {
      d += n;
    }
    l = a[1] + n - 1;
    for (i = 2; i <= x; i++) {
      if (a[i] - a[i - 1] + l <= m - 1) {
        if (l >= a[i]) {
          if ((a[i] - a[i - 1]) % z == 0) {
            d += a[i] - a[i - 1];
            l = a[i] - a[i - 1] + l;
          } else
            break;
        } else {
          d += n;
          l = a[i] + n - 1;
        }
      } else
        break;
    }
  }
  if (i != x + 1 && x >= 1)
    cout << 0 << endl;
  else {
    long long ans = 1;
    for (i = 1; i <= m - d; i++) {
      ans = (ans % 1000000007 * 26 % 1000000007) % 1000000007;
    }
    cout << ans << endl;
  }
  return 0;
}
