#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline string toString(T a) {
  ostringstream os("");
  os << a;
  return os.str();
}
template <typename T>
inline long long toLong(T a) {
  long long res;
  istringstream os(a);
  os >> res;
  return res;
}
template <typename T>
inline T SQ(T a) {
  return a * a;
}
template <typename T>
inline unsigned long long bigmod(T a, T b, T m) {
  if (b == 0)
    return 1;
  else if (b % 2 == 0)
    return SQ(bigmod(a, b / 2, m)) % m;
  else
    return (a % m * bigmod(a, b - 1, m)) % m;
}
template <typename T>
inline vector<string> parse(T str) {
  vector<string> res;
  string s;
  istringstream os(str);
  while (os >> s) res.push_back(s);
  return res;
}
template <typename T>
inline unsigned long long dist(T A, T B) {
  unsigned long long res =
      (A.x - B.x) * (A.x - B.x) + (A.y - B.y) * (A.y - B.y);
  return res;
}
template <typename T>
inline double cosAngle(T a, T b, T c) {
  double res = a * a + b * b - c * c;
  res = res / (2 * a * b);
  res = acos(res);
  return res;
}
char t[1000005];
char p[1000005];
int tlen, plen;
vector<int> v;
vector<int> duplicate;
int match[1000005];
int ase[1000005];
void build() {
  match[0] = -1;
  match[1] = 0;
  int i, j;
  j = 0;
  for (i = 2; i <= plen;) {
    if (p[i - 1] == p[j]) {
      j++;
      match[i] = j;
      i++;
    } else if (j > 0)
      j = match[j];
    else {
      match[i] = 0;
      i++;
    }
  }
}
void kmp() {
  int i, m;
  for (i = 0, m = 0; i + m < tlen;) {
    if (p[i] == t[i + m]) {
      ase[i + m] = i + 1;
      i++;
      if (i == plen) {
        duplicate.push_back(i + m - plen + 1);
      }
    } else {
      m = m + i - match[i];
      if (m < 0) m = 0;
      if (match[i] > 0)
        i = match[i];
      else
        i = 0;
    }
  }
}
int last;
void generate(int x) {
  int low = x;
  int high = min(last - 1, x + plen - 1);
  for (int i = low, j = 0; i <= high; i++, j++) {
    t[i] = p[j];
  }
  last = min(last, low);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie();
  int n, m, x;
  cin >> n >> m;
  last = n;
  cin >> p;
  plen = strlen(p);
  for (int i = (1); i <= (m); i++) {
    cin >> x;
    v.push_back(x);
  }
  for (int i = 0; i < n; i++) t[i] = '*';
  for (int i = m - 1; i >= 0; i--) {
    generate(v[i] - 1);
  }
  t[n] = '\0';
  tlen = strlen(t);
  plen = strlen(p);
  build();
  kmp();
  long long ans = 0;
  bool ok = 1;
  for (int i = 0; i < v.size(); i++) {
    if (binary_search((duplicate).begin(), (duplicate).end(), v[i]))
      ;
    else
      ok = 0;
  }
  if (ok) {
    ans = 1;
    int cn = 0;
    for (int i = (0); i <= (n - 1); i++)
      if (t[i] == '*') cn++;
    ans = bigmod((long long)26, (long long)cn, 1000000007LL);
  }
  cout << ans << endl;
  return 0;
}
