#include <bits/stdc++.h>
using namespace std;
long long ans = 1;
int n, m, a[1000005], z[1000005], x, mod = 1e9 + 7;
string second;
int main() {
  cin >> n >> m >> second;
  for (int i = 1, l = 0, r = 0; i < second.size(); i++) {
    if (i <= r) z[i] = min(r - i + 1, z[i - l]);
    while (i + z[i] < second.size() && second[z[i]] == second[i + z[i]]) z[i]++;
    if (i + z[i] - 1 > r) l = i, r = i + z[i] - 1;
  }
  int prev = -1, len = second.size();
  for (int i = 0; i < m; i++) {
    scanf("%d", &x);
    x--;
    int st = x, fn = x + len;
    if (prev != -1 && prev + len > x) {
      if (z[x - prev] < prev + len - x) {
        cout << 0;
        return 0;
      }
      st = prev + len;
    }
    for (int j = st; j < fn; j++) a[j] = 1;
    prev = x;
  }
  for (int i = 0; i < n; i++)
    if (a[i] == 0) ans = (ans * 26) % mod;
  cout << ans;
  return 0;
}
