#include <bits/stdc++.h>
using namespace std;
void build_z_function(string& s, vector<int>& z) {
  int n = s.size();
  z = vector<int>(n);
  z[0] = n;
  int L = 0, R = 0;
  for (int i = 1; i < n; i++) {
    if (i > R) {
      L = R = i;
      while (R < n && s[R - L] == s[R]) {
        R++;
      }
      z[i] = R - L;
      R--;
    } else {
      int k = i - L;
      if (z[k] < R - i + 1) {
        z[i] = z[k];
      } else {
        L = i;
        while (R < n && s[R - L] == s[R]) R++;
        z[i] = R - L;
        R--;
      }
    }
  }
}
using ll = long long;
ll mod = 1000000007;
int main() {
  ios::sync_with_stdio(false);
  int n, m;
  string s;
  cin >> n >> m >> s;
  string ans(n, '?');
  vector<int> z;
  build_z_function(s, z);
  bool flag = true;
  for (int i = 0, last = 0; i < m; i++) {
    int k;
    cin >> k;
    --k;
    if (k >= last) {
      for (int j = 0; j < s.size(); j++) {
        ans[k + j] = s[j];
      }
    } else {
      int l = (k - last) + int(s.size());
      if (l + z[l] == int(s.size())) {
        for (int j = last - k; j < s.size(); j++) {
          ans[k + j] = s[j];
        }
      } else {
        flag = false;
        break;
      }
    }
    last = k + s.size();
  }
  ll total = 0;
  if (flag) {
    total = 1;
    for (char ch : ans) {
      if (ch == '?') {
        total = (total * 26LL) % mod;
      }
    }
  }
  cout << total << endl;
  return 0;
}
