#include <bits/stdc++.h>
using namespace std;
const long long pri = pow(10, 9) + 7;
long long myPow(long long a, long long b) {
  if (b == 0)
    return 1;
  else if (b % 2 == 0) {
    long long ans = myPow(a, b / 2);
    ans *= ans;
    ans %= pri;
    return ans;
  } else {
    long long ans = myPow(a, (b - 1) / 2);
    ans *= ans;
    ans %= pri;
    ans *= a;
    ans %= pri;
    return ans;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  ;
  int precision = numeric_limits<double>::digits10;
  ;
  int n, m;
  cin >> n >> m;
  string t(n, '.'), p;
  cin >> p;
  long long pas = -1;
  vector<int> num(m);
  for (int i = 0; i < m; i++) {
    int temp;
    cin >> temp;
    num[i] = temp - 1;
    if (num[i] > pas) {
      for (int j = 0; j < p.size(); j++) {
        t[num[i] + j] = p[j];
        if (j == p.size() - 1) pas = num[i] + j;
      }
    } else {
      for (int j = pas + 1 - num[i]; j < p.size(); j++) {
        t[num[i] + j] = p[j];
        if (j == p.size() - 1) pas = num[i] + j;
      }
    }
  }
  string s = p + "*" + t;
  int N = s.size();
  int L = 0, R = 0;
  int z[N];
  for (int i = 0; i < N; i++) z[i] = 0;
  z[0] = N;
  for (int i = 1; i < N; i++) {
    if (i > R) {
      L = R = i;
      while (R < N and s[R - L] == s[R]) R++;
      z[i] = R - L;
      if (z[i] == 0)
        L = R = 0;
      else
        R--;
    } else {
      int k = i - L;
      if (z[k] < R - i + 1)
        z[i] = z[k];
      else {
        L = i;
        while (R < N and s[R - L] == s[R]) R++;
        z[i] = R - L;
        if (z[i] == 0)
          L = R = 0;
        else
          R--;
      }
    }
  }
  bool valid = true;
  for (int i = 0; i < m; i++) {
    if (z[num[i] + p.size() + 1] != p.size()) {
      valid = false;
      break;
    }
  }
  if (!valid)
    cout << 0 << endl;
  else {
    long long count = 0;
    for (int i = 0; i < t.size(); i++)
      if (t[i] == '.') count++;
    cout << myPow((long long)26, count) << endl;
  }
}
