#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 5;
long long int power(long long int base, long long int exp, long long int mod) {
  long long int res = 1;
  while (exp) {
    if (exp % 2) res *= base;
    base *= base;
    res %= mod;
    base %= mod;
    exp /= 2;
  }
  return res;
}
int arr[maxn];
char str[maxn];
long long int p1 = 31, p2 = 37, pp1[maxn], pp2[maxn], pre1[maxn], pre2[maxn];
long long int mod1 = 1e9 + 7, mod2 = 1e9 + 9, n, m;
string p;
long long int hash_1(long long int l, long long int r) {
  return ((pre1[r] - pre1[l - 1] + mod1) * power(pp1[l - 1], mod1 - 2, mod1)) %
         mod1;
}
long long int hash_2(long long int l, long long int r) {
  return ((pre2[r] - pre2[l - 1] + mod2) * power(pp2[l - 1], mod2 - 2, mod2)) %
         mod2;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int x, i;
  pp1[0] = 1;
  pp2[0] = 1;
  for (i = 1; i < maxn; i++) {
    pp1[i] = (p1 * pp1[i - 1]) % mod1;
    pp2[i] = (p2 * pp2[i - 1]) % mod2;
  }
  cin >> n >> m;
  cin >> p;
  p = "$" + p;
  for (i = 1; i < int(p.size()); i++) {
    pre1[i] = (pre1[i - 1] + (p[i] - 'a' + 1) * pp1[i]) % mod1;
    pre2[i] = (pre2[i - 1] + (p[i] - 'a' + 1) * pp2[i]) % mod2;
  }
  for (i = 1; i <= m; i++) {
    cin >> x;
    arr[x] = 1;
  }
  long long int curr = int(p.size()), ans = 0;
  for (i = 1; i <= n; i++) {
    if (arr[i]) {
      if (curr < int(p.size())) {
        long long int hash11 = hash_1(curr, int(p.size()) - 1);
        long long int hash21 = hash_2(curr, int(p.size()) - 1);
        long long int hash12 = hash_1(1, int(p.size()) - curr);
        long long int hash22 = hash_2(1, int(p.size()) - curr);
        if (hash11 != hash12 || hash21 != hash22) {
          cout << "0";
          return 0;
        }
      }
      curr = 1;
    }
    if (curr < int(p.size())) {
      curr++;
    } else {
      ans++;
    }
  }
  cout << power(26, ans, mod1);
  return 0;
}
