#include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
int n, m, y, sum, z[1000000];
vector<int> x;
string p;
long long pow(int k) {
  long long p = 26, ans = 1;
  for (int i = 0; i < 20; i++) {
    if (k & 1) ans = ans * p % MOD;
    p = p * p % MOD;
    k /= 2;
  }
  return ans;
}
void genz() {
  int L = 0, R = 0;
  for (int i = 1; i < p.length(); i++) {
    if (i > R) {
      L = R = i;
      while (R < p.length() && p[R - L] == p[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 < p.length() && p[R - L] == p[R]) R++;
        z[i] = R - L;
        R--;
      }
    }
  }
}
int main() {
  cin >> n >> m >> p;
  for (int i = 0; i < m; i++) {
    cin >> y;
    x.push_back(y);
  }
  genz();
  if (x.size() == 0) {
    cout << pow(n);
    return 0;
  }
  for (int i = 0; i < x.size() - 1; i++) {
    if (x[i + 1] - x[i] >= p.length())
      sum += p.length();
    else {
      int k = x[i + 1] - x[i];
      if (z[k] + k == p.length())
        sum += (x[i + 1] - x[i]);
      else {
        cout << 0;
        return 0;
      }
    }
  }
  sum += p.length();
  cout << pow(n - sum);
  return 0;
}
