#include <bits/stdc++.h>
using namespace std;
int mult(int x, int y) {
  long long int ans, x1 = (long long int)x, y1 = (long long int)y;
  ans = (x1 * y1) % 1000000007;
  return (int)ans;
}
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int lcm(int a, int b) { return a * (b / gcd(a, b)); }
int pow1(int a, int b) {
  int ans = 1;
  while (b > 0) {
    if (b & 1) ans = mult(ans, a);
    a = mult(a, a);
    b >>= 1;
  }
  return ans;
}
int mina(int arr[], int n) {
  int x = arr[0], i, pos = 0;
  for (i = 1; i < n; i++) {
    if (arr[i] < x) {
      x = arr[i];
      pos = i;
    }
  }
  return x;
}
int maxa(int arr[], int n) {
  int x = arr[0], i, pos = 0;
  for (i = 1; i < n; i++) {
    if (arr[i] > x) {
      x = arr[i];
      pos = i;
    }
  }
  return x;
}
int a[5000005], b[5000005], z[5000005];
int main() {
  int n, m, i, l = 0, r = 0;
  scanf("%d", &n);
  scanf("%d", &m);
  memset(a, 0, sizeof(a));
  memset(z, 0, sizeof(z));
  string s;
  cin >> s;
  z[0] = s.size();
  for (i = 1; i < s.size(); i++) {
    if (r <= i) {
      l = r = i;
      while (r < n && s[r - l] == s[r]) r++;
      z[i] = r - l;
    } else {
      int k = i - l;
      if (z[k] < r - i)
        z[i] = z[k];
      else {
        l = i;
        while (r < n && s[r - l] == s[r]) r++;
        z[i] = r - l;
      }
    }
  }
  memset(b, 0, sizeof(b));
  for (i = 0; i < m; i++) {
    scanf("%d", &a[i]);
    a[i]--;
    b[a[i]]++;
    b[a[i] + s.size()]--;
  }
  for (i = 1; i < m; i++) {
    int x = a[i - 1] + s.size() - a[i];
    if (x <= 0) continue;
    if (z[s.size() - x] < x) {
      cout << "0" << endl;
      return 0;
    }
  }
  for (i = 1; i < n; i++) b[i] += b[i - 1];
  long long int ans = 1;
  for (i = 0; i < n; i++) {
    if (b[i] == 0) ans = (ans * 26) % 1000000007;
  }
  printf("%lld\n", ans % 1000000007);
  return 0;
}
