#include <bits/stdc++.h>
using namespace std;
const long long mox = 1e6 + 9;
long long ha[mox];
long long mod = 1e9 + 7;
long long d[mox];
bool visit[mox];
long long ma[mox];
bool visit2[mox];
long long ta(long long a, long long b) {
  long long ans = 1;
  long long c = a;
  while (b) {
    if (b % 2) {
      ans = (ans * c) % mod;
    }
    c = (c * c) % mod;
    b /= 2;
  }
  return ans;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  string t;
  cin >> t;
  d[0] = 1;
  for (long long i = 0; i < t.size(); i++) {
    long long x = (d[i] * (t[i] - 'a' + 1)) % mod;
    ha[i] = (ha[i - 1] + x) % mod;
    d[i + 1] = (d[i] * 27) % mod;
  }
  long long ans = 0;
  for (long long i = t.size() - 1; i >= 1; i--) {
    long long x = (ha[t.size() - 1] - ha[i - 1] + mod) % mod;
    long long y = ta(d[i], mod - 2);
    x = (x * y) % mod;
    if (x == ha[t.size() - 1 - i]) {
      visit[i] = 1;
    }
  }
  for (long long i = 0; i < m; i++) {
    cin >> ma[i];
    visit2[ma[i]] = 1;
  }
  for (long long i = 1; i < m; i++) {
    if (ma[i] - ma[i - 1] < t.size()) {
      if (visit[ma[i] - ma[i - 1]] == 0) {
        cout << 0;
        exit(0);
      }
    }
  }
  long long x = 0;
  long long o = 0;
  for (long long i = 1; i <= n; i++) {
    if (visit2[i] == 1) {
      x = i + t.size() - 1;
    }
    if (i > x) {
      o += 1;
    }
  }
  long long w = 1;
  for (long long i = 0; i < o; i++) {
    w = (w * 26) % mod;
  }
  cout << w;
}
