#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:128000000")
using namespace std;
void solve();
void precalc();
clock_t start;
bool doing = true;
int main() {
  int t = 1;
  cout.sync_with_stdio(0);
  cin.tie(0);
  precalc();
  cout.precision(10);
  cout << fixed;
  start = clock();
  int testNum = 1;
  while (t--) {
    solve();
  }
  return 0;
}
void precalc() {}
int binpow(int q, int w, int mod) {
  if (!w) return 1;
  if (w & 1) return q * binpow(q, w - 1, mod) % mod;
  return binpow(q * q % mod, w / 2, mod);
}
int gcd(int q, int w) {
  while (w) {
    q %= w;
    swap(q, w);
  }
  return q;
}
void zFunction(const string& s, vector<int>& z) {
  int n = s.length();
  if (n == 0) return;
  z.resize(n);
  z[0] = 0;
  int l = 0, r = 0;
  for (int i = 1; i < n; ++i) {
    if (i <= r) z[i] = min(z[i - l], r - i + 1);
    while (i + z[i] < n && s[i + z[i]] == s[z[i]]) ++z[i];
    if (i + z[i] - 1 > r) {
      l = i;
      r = i + z[i] - 1;
    }
  }
}
void solve() {
  int n, m;
  string p;
  cin >> n >> m >> p;
  vector<int> poses(m);
  for (int i = 0; i < m; ++i) {
    cin >> poses[i];
    --poses[i];
  }
  string s(n, 0);
  for (int i = 0; i < m; ++i) {
    int curPos = poses[i];
    while (curPos < n && curPos - poses[i] < p.length()) {
      if (i + 1 < m && curPos == poses[i + 1]) {
        break;
      }
      s[curPos] = p[curPos - poses[i]];
      ++curPos;
    }
  }
  vector<int> z;
  zFunction(p + '#' + s, z);
  for (int i = 0; i < m; ++i) {
    int pos = poses[i] + p.length() + 1;
    if (z[pos] != p.length()) {
      cout << "0\n";
      return;
    }
  }
  long long ans = 1;
  for (int i = 0; i < n; ++i) {
    if (s[i] == 0) {
      ans = ans * 26 % 1000000007;
    }
  }
  cout << ans << "\n";
}
