#include <bits/stdc++.h>
using namespace std;
int t[4000005], lazy[4000005];
long long ans, mod = 1e9 + 7;
int arr[1000005];
void update(int node, int a, int b, int i, int j, int value) {
  if (lazy[node] != 0) {
    t[node] = lazy[node];
    if (a != b) {
      lazy[node * 2 + 1] = lazy[node];
      lazy[node * 2 + 2] = lazy[node];
    }
    lazy[node] = 0;
  }
  if (a > j || b < i) return;
  if (a >= i && b <= j) {
    t[node] = value;
    if (a != b) {
      lazy[node * 2 + 1] = value;
      lazy[node * 2 + 2] = value;
    }
    return;
  }
  update(node * 2 + 1, a, (a + b) / 2, i, j, value);
  update(node * 2 + 2, 1 + (a + b) / 2, b, i, j, value);
  t[node] = t[node * 2 + 1] + t[node * 2 + 2];
}
int query(int node, int a, int b, int i, int j) {
  if (lazy[node] != 0) {
    t[node] = lazy[node];
    if (a != b) {
      lazy[node * 2 + 1] = lazy[node];
      lazy[node * 2 + 2] = lazy[node];
    }
    lazy[node] = 0;
  }
  if (a > j || b < i) return 0;
  if (a >= i && b <= j) {
    return t[node];
  }
  int mid = (a + b) / 2;
  return query(node * 2 + 1, a, mid, i, j) +
         query(node * 2 + 2, mid + 1, b, i, j);
}
int main() {
  int n, m;
  string s;
  cin.tie(0);
  cin >> n >> m >> s;
  int len = s.size();
  for (int i = 1; i <= m; i++) {
    scanf("%d", &arr[i]);
    update(0, 0, n - 1, arr[i] - 1, min(arr[i] - 1 + len - 1, n - 1), 1);
    int dif = arr[i] - arr[i - 1];
    if (i == 1) dif = 0;
    if (dif < len && s[0] != s[dif]) {
      return cout << 0, 0;
    }
  }
  ans = 1;
  for (int i = 1; i <= n; i++) {
    if (!query(0, 0, n - 1, i - 1, i - 1)) ans = (ans * 26) % mod;
  }
  cout << ans;
  return 0;
}
