#include <bits/stdc++.h>
using namespace std;
inline int two(int n) { return 1 << n; }
inline int test(int n, int b) { return n & two(b); }
inline void set_bit(int& n, int b) { n |= two(b); }
inline void unset_bit(int& n, int b) { n &= ~two(b); }
inline int last_bit(int n) { return n & (-n); }
inline int ones(int n) {
  int res = 0;
  while (n && ++res) n -= n & (-n);
  return res;
}
int n, m, vis[1000007], z[1000007], x[1000007];
string p, s;
void z_algorithm(string s) {
  int ns = s.size();
  int L = 0, R = 0;
  for (int i = 1; i < ns; i++) {
    if (i > R) {
      L = R = i;
      while (R < ns && s[R - L] == s[R]) R++;
      z[i] = R - L;
      R--;
    } else {
      int k = i - L;
      if (z[k] < R - i + 1)
        z[i] = z[k];
      else {
        L = i;
        while (R < ns && s[R - L] == s[R]) R++;
        z[i] = R - L;
        R--;
      }
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long ans = 1;
  memset(vis, (0), sizeof(vis));
  cin >> n >> m >> p;
  int len = p.size();
  for (int i = 0; i < m; i++) {
    cin >> x[i];
    vis[x[i]]++;
  }
  s = "";
  int curr = 0;
  for (int i = 1; i <= n; ++i) {
    if (vis[i]) {
      curr = i;
    }
    if (curr == 0) {
      s.push_back('?');
      continue;
    }
    if (i - curr < p.size()) {
      s.push_back(p[i - curr]);
    } else {
      s.push_back('?');
    }
  }
  string check = p;
  check += '$';
  check += s;
  z_algorithm(check);
  for (int i = 0; i < m; i++) {
    if (z[len + x[i]] != len) {
      cout << 0 << endl;
      return 0;
    }
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == '?') {
      ans = (ans * 26) % 1000000007;
    }
  }
  cout << ans << endl;
  return 0;
}
