#include <bits/stdc++.h>
using namespace std;
template <typename input_type>
input_type get() {
  input_type input;
  cin >> input;
  return input;
}
const int alpha = 26;
const long long int mod = 1e9 + 7;
long long int power(long long int base, int exp) {
  if (exp == 0) {
    return 1;
  } else if (exp % 2) {
    return (power(base, exp - 1) * base) % mod;
  } else {
    long long int tmp = power(base, exp / 2);
    return (tmp * tmp) % mod;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int sz = get<int>(), query = get<int>();
  long long int last;
  string str = get<string>();
  for (int q = 0; q < query; q++) {
    int loc = get<int>();
    if ((q == 0) or (loc - last >= str.length())) {
      sz -= str.length();
    } else if (str[loc - last] != str[0]) {
      cout << 0;
      return 0;
    } else {
      sz -= loc - last;
    }
    last = loc;
  }
  cout << power(alpha, sz);
  return 0;
}
