#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &t) {
  os << "[";
  for (__typeof((t).begin()) it = (t).begin(); it != (t).end(); it++) {
    if (it != t.begin()) os << ",";
    os << *it;
  }
  os << "]";
  return os;
}
template <class T>
ostream &operator<<(ostream &os, const set<T> &t) {
  os << "{";
  for (__typeof((t).begin()) it = (t).begin(); it != (t).end(); it++) {
    if (it != t.begin()) os << ",";
    os << *it;
  }
  os << "}";
  return os;
}
template <class S, class T>
ostream &operator<<(ostream &os, const pair<S, T> &t) {
  return os << "(" << t.first << "," << t.second << ")";
}
template <class S, class T>
pair<S, T> operator+(const pair<S, T> &s, const pair<S, T> &t) {
  return pair<S, T>(s.first + t.first, s.second + t.second);
}
template <class S, class T>
pair<S, T> operator-(const pair<S, T> &s, const pair<S, T> &t) {
  return pair<S, T>(s.first - t.first, s.second - t.second);
}
const int INF = 1 << 28;
const double EPS = 1e-8;
const int MOD = 1000000007;
struct SuffixArray {
  template <bool End, class T>
  vector<int> compute_buckets(const T *s, int n, int k) const {
    vector<int> buckets(k);
    for (int i = 0; i < (int)(n); i++) ++buckets[s[i]];
    int sum = 0;
    for (int i = 0; i < (int)(k); i++) {
      sum += buckets[i];
      buckets[i] = (End ? sum : (sum - buckets[i]));
    }
    return buckets;
  }
  template <class T>
  void induce_sa_l(int *sa, const T *s, int n, int k,
                   const vector<int> &ls) const {
    vector<int> buckets(compute_buckets<false>(s, n, k));
    for (int i = 0; i < (int)(n); i++) {
      const int j = sa[i] - 1;
      if (j >= 0 && !ls[j]) {
        sa[buckets[s[j]]++] = j;
      }
    }
  }
  template <class T>
  void induce_sa_s(int *sa, const T *s, int n, int k,
                   const vector<int> &ls) const {
    vector<int> buckets(compute_buckets<true>(s, n, k));
    for (int i = ((int)(n)-1); i >= 0; i--) {
      const int j = sa[i] - 1;
      if (j >= 0 && ls[j]) {
        sa[--buckets[s[j]]] = j;
      }
    }
  }
  bool is_lms(const vector<int> &ls, int i) const {
    return i > 0 && !ls[i - 1] && ls[i];
  }
  template <class T>
  void sa_is(int *sa, const T *s, int n) const {
    vector<int> ls(n);
    ls[n - 1] = 1;
    for (int i = ((int)(n - 1) - 1); i >= 0; i--)
      ls[i] = (s[i] != s[i + 1]) ? s[i] < s[i + 1] : ls[i + 1];
    const int k = (int)*std::max_element(s, s + n) + 1;
    vector<int> buckets = compute_buckets<true>(s, n, k);
    for (int i = 0; i < (int)(n); i++) sa[i] = -1;
    for (int i = 1; i <= (int)(n - 1); i++)
      if (is_lms(ls, i)) sa[--buckets[s[i]]] = i;
    induce_sa_l(sa, s, n, k, ls);
    induce_sa_s(sa, s, n, k, ls);
    int m = 0;
    for (int i = 0; i < (int)(n); i++)
      if (is_lms(ls, sa[i])) sa[m++] = sa[i];
    for (int i = m; i < n; i++) sa[i] = -1;
    int num = 0, prev = -1;
    for (int i = 0; i < (int)(m); i++) {
      int p = sa[i], diff = 0;
      for (int d = 0; d < (int)(n); d++) {
        const int l = p + d, r = prev + d;
        if (prev < 0 || s[l] != s[r] || ls[l] != ls[r]) {
          diff = 1;
          break;
        } else if (d > 0 && (is_lms(ls, l) || is_lms(ls, r))) {
          break;
        }
      }
      if (diff) {
        num++;
        prev = p;
      }
      p = (p - (p & 1)) / 2;
      sa[m + p] = num - 1;
    }
    for (int i = n - 1, j = n - 1; i >= m; i--)
      if (sa[i] >= 0) sa[j--] = sa[i];
    int *reduced_s = sa + n - m;
    if (num < m)
      sa_is(sa, reduced_s, m);
    else
      for (int i = 0; i < (int)(m); i++) sa[reduced_s[i]] = i;
    buckets = compute_buckets<true>(s, n, k);
    int j = 0;
    for (int i = 1; i <= (int)(n - 1); i++)
      if (is_lms(ls, i)) reduced_s[j++] = i;
    for (int i = 0; i < (int)(m); i++) sa[i] = reduced_s[sa[i]];
    for (int i = m; i < n; i++) sa[i] = -1;
    for (int i = ((int)(m)-1); i >= 0; i--) {
      const int j = sa[i];
      sa[i] = -1;
      sa[--buckets[s[j]]] = j;
    }
    induce_sa_l(sa, s, n, k, ls);
    induce_sa_s(sa, s, n, k, ls);
  }
  vector<int> sa;
  template <class T>
  vector<int> sa_is(const T &s) const {
    if (s.size() == 0) {
      return vector<int>(1);
    }
    const int n = s.size() + 1;
    vector<int> vs(n), sa(n);
    ;
    for (int i = 0; i < (int)(n - 1); i++) {
      vs[i] = s[i];
    }
    sa_is(&sa[0], &vs[0], n);
    return sa;
  }
  template <class T>
  explicit SuffixArray(const T &s) : sa(sa_is(s)) {}
  size_t size() const { return sa.size(); }
  int operator[](int i) const { return sa[i]; }
};
struct LCP {
  int n;
  vector<int> vs, isa, lcp;
  template <class T>
  LCP(const T &s, const vector<int> &sa)
      : n(sa.size()), vs(n), isa(n), lcp(n - 1) {
    for (int i = 0; i < (int)(n - 1); i++) vs[i] = s[i];
    for (int i = 0; i < (int)(n); i++) isa[sa[i]] = i;
    int h = 0, j;
    for (int i = 0; i < (int)(n); i++)
      if ((j = isa[i]) > 0) {
        while (vs[sa[j] + h] == vs[sa[j - 1] + h]) h++;
        lcp[j - 1] = h;
        if (h > 0) --h;
      }
  }
  int operator[](int i) const { return lcp[i]; }
};
int n, m;
string s;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m >> s;
  SuffixArray sa(s);
  LCP lcp(s, sa.sa);
  vector<int> &isa = lcp.isa;
  vector<int> minsum(s.size() + 1);
  minsum[0] = s.size();
  for (int i = isa[0] - 1; i >= 0; i--)
    minsum[sa[i]] = min(lcp[i], minsum[sa[i + 1]]);
  for (int i = isa[0] + 1; i < s.size(); i++)
    minsum[sa[i]] = min(lcp[i - 1], minsum[sa[i - 1]]);
  vector<int> y(m);
  for (int i = 0; i < (int)(m); i++) {
    cin >> y[i];
    y[i]--;
  }
  sort((y).begin(), (y).end());
  y.push_back(INF);
  int c = -1, j = 0, k = 0, node = 0;
  long long int ans = 1;
  for (int i = 0; i < (int)(n); i++) {
    if (y[j] == i) {
      if (max(0, c) + minsum[max(0, c)] < s.size()) {
        cout << 0 << endl;
        return 0;
      }
      c = 0;
      j++;
    }
    if (c == -1)
      ans = ans * 26 % MOD;
    else {
      if (++c == s.size()) c = -1;
    }
  }
  cout << (c == -1 ? ans : 0ll) << endl;
  return 0;
}
