#include <bits/stdc++.h>
using namespace std;
int F(const void* l, const void* r) { return (*(int*)l - *(int*)r); }
const long long inf = 1000000007;
int n, m;
string s;
string c;
int x[1010010];
long long ch = 1;
vector<int> zf, pf;
vector<int> z_function(string s) {
  int n = (int)s.length();
  vector<int> z(n);
  for (int i = 1, l = 0, r = 0; i < n; ++i) {
    if (i <= r) z[i] = min(r - i + 1, z[i - l]);
    while (i + z[i] < n && s[z[i]] == s[i + z[i]]) ++z[i];
    if (i + z[i] - 1 > r) l = i, r = i + z[i] - 1;
  }
  return z;
}
vector<int> prefix_function(string s) {
  int n = (int)s.length();
  vector<int> pi(n);
  for (int i = 1; i < n; ++i) {
    int j = pi[i - 1];
    while (j > 0 && s[i] != s[j]) j = pi[j - 1];
    if (s[i] == s[j]) ++j;
    pi[i] = j;
  }
  return pi;
}
int main() {
  ios::ios_base::sync_with_stdio(false);
  cin >> n >> m;
  cin >> s;
  c.resize(n + s.length() + 1);
  zf = z_function(s);
  pf = prefix_function(s);
  if (m == 0) {
    for (long long i = 0; i < n; i++) {
      ch *= 26;
      ch %= inf;
    }
    cout << ch;
    return 0;
  }
  for (long long i = 0; i < m; i++) {
    cin >> x[i];
    x[i]--;
  }
  int u = s.length(), j = 0;
  int k = 0;
  for (long long i = 0; i < s.length(); i++) c[i] = s[i];
  for (long long i = s.length(); i <= n + s.length() - 1; i++) {
    if (x[j] != i - s.length()) {
      u++;
      if (u >= s.length())
        c[i] = '-', k++;
      else
        c[i] = s[u];
    } else {
      j++;
      u = 0;
      c[i] = s[u];
    }
  }
  j = 0;
  u = 0;
  int q = s.length();
  int t = pf[s.length() - 1];
  for (long long i = s.length(); i <= n + s.length() - 1; i++) {
    if (x[j] != i - s.length()) {
      if (j != 0) u++;
      if (u == 0 || u >= s.length()) {
        continue;
      } else {
        if (c[i] != s[u]) {
          {
            cout << "0" << endl;
            return 0;
          };
        }
      }
    } else {
      j++;
      if (j == 1) {
        if (c[i] != s[u]) {
          {
            cout << "0" << endl;
            return 0;
          };
        }
        u = 0;
        continue;
      }
      if (t < q - u - 1) {
        {
          cout << "0" << endl;
          return 0;
        };
      }
      if (t == q - u - 1) {
        u = 0;
        continue;
      } else {
        if (q - u - 1 < s.size() && pf[q - u - 1] < q - u - 1) {
          cout << "0" << endl;
          return 0;
        };
      }
      u = 0;
    }
  }
  if (k == 0) {
    cout << 1;
    return 0;
  }
  for (long long i = 0; i < k; i++) {
    ch *= 26;
    ch %= inf;
  }
  cout << ch;
  return 0;
}
