#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using int64 = long long int;
template <typename T>
void chmax(T &a, T b) {
  a = max(a, b);
}
template <typename T>
void chmin(T &a, T b) {
  a = min(a, b);
}
template <typename T>
void chadd(T &a, T b) {
  a = a + b;
}
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const ll INF = 1001001001001001LL;
const ll MOD = 1000000007LL;
template <typename ArrayType>
struct Z_algorithm {
  ArrayType v;
  vector<int> Z;
  void build() {
    int N = v.size(), i, j;
    Z = vector<int>(N);
    for (i = 1, j = 0; i < N; i++) {
      int l = i - j;
      if (i + Z[l] < j + Z[j]) {
        Z[i] = Z[l];
      } else {
        int k = max(0, j + Z[j] - i);
        while (i + k < N and v[k] == v[i + k]) k++;
        Z[i] = k;
        j = i;
      }
    }
    Z[0] = N;
  }
  Z_algorithm(ArrayType v_) : v(v_) { build(); }
  int get_lcp(int idx) { return Z[idx]; }
};
int main() {
  int N, M;
  scanf("%d%d", &N, &M);
  string s;
  cin >> s;
  int P = s.size();
  Z_algorithm<string> za(s);
  vector<int> exist(N);
  for (int i = 0; i < M; i++) {
    int x;
    scanf("%d", &x);
    x--;
    exist[x] = true;
  }
  ll ans = 1, last = -2 * P;
  for (int i = 0; i < N; i++) {
    if (exist[i]) {
      if (i - last < P) {
        if (za.get_lcp(i - last) != P - i + last) {
          cout << 0 << endl;
          return 0;
        }
      }
      last = i;
    } else {
      if (i - last >= P) (ans *= 26) %= MOD;
    }
  }
  cout << ans << endl;
  return 0;
}
