#include <bits/stdc++.h>
using namespace std;
long long pwr(long long a, long long b, long long mod) {
  a %= mod;
  if (a < 0) a += mod;
  long long ans = 1;
  while (b) {
    if (b & 1) ans = (ans * a) % mod;
    a = (a * a) % mod;
    b /= 2;
  }
  return ans;
}
long long pwr(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans *= a;
    a *= a;
    b /= 2;
  }
  return ans;
}
long long gcd(long long a, long long b) {
  while (b) {
    long long temp = a;
    a = b;
    b = temp % b;
  }
  return a;
}
long long lcm(long long a, long long b) { return (a / gcd(a, b)) * b; }
long long modularInverse(long long a, long long m) {
  assert(false);
  return pwr(a, m - 2, m);
}
const int mod = 1000000007;
class Hash {
 private:
  long long X[2], MOD[2];
  vector<vector<int> > xpwr;

 protected:
  long long pwr(long long a, long long b, long long MOD) {
    long long ans = 1;
    while (b) {
      if (b & 1) ans = (ans * a) % MOD;
      a = (a * a) % MOD;
      b >>= 1;
    }
    return ans;
  }

 public:
  template <typename T>
  int hash(const T& s, long long X, long long MOD) {
    long long ans = 0;
    long long mul = 1;
    for (int i = 0; i < s.size(); ++i) {
      mul *= X;
      mul %= MOD;
      ans += s[i] * mul;
      ans %= MOD;
    }
    if (ans < 0) ans += MOD;
    return (int)ans;
  }
  template <typename T>
  pair<int, int> hash(const T& s) {
    pair<int, int> ans;
    ans.first = hash(s, X[0], MOD[0]);
    ans.second = hash(s, X[1], MOD[1]);
    return ans;
  }
  Hash() {
    MOD[0] = 999999937;
    MOD[1] = 999999929;
    X[0] = 37;
    X[1] = 31;
    xpwr.resize(1 + max(X[0], X[1]));
    xpwr[X[0]].resize(1000006);
    xpwr[X[1]].resize(1000006);
    xpwr[X[0]][0] = 1;
    xpwr[X[1]][0] = 1;
    for (int i = 1; i <= 1000000; ++i) {
      xpwr[X[0]][i] = ((long long)xpwr[X[0]][i - 1] * X[0]) % MOD[0];
      xpwr[X[1]][i] = ((long long)xpwr[X[1]][i - 1] * X[1]) % MOD[1];
    }
  }

 private:
  int replaceOneChar(int oldHash, int index, int oldVal, int newVal, int X,
                     int MOD) {
    long long mul = xpwr[X][index + 1];
    long long ans = oldHash + (newVal - oldVal) * mul;
    if (ans >= MOD || ans <= -MOD) ans %= MOD;
    if (ans < 0) ans += MOD;
    return (int)ans;
  }
  int pushBackCharacter(int oldHash, int index, int newVal, int X, int MOD) {
    long long mul = xpwr[X][index + 1];
    long long ans = oldHash + newVal * mul;
    if (ans >= MOD || ans <= -MOD) ans %= MOD;
    if (ans < 0) ans += MOD;
    return (int)ans;
  }
  int pushFrontCharacter(int oldHash, int newVal, int X, int MOD) {
    long long ans = ((long long)oldHash + newVal) * X;
    if (ans >= MOD || ans <= -MOD) ans %= MOD;
    if (ans < 0) ans += MOD;
    return (int)ans;
  }
  int mergeHash(int pre, int post, int prelen, int X, int MOD) {
    long long mul = xpwr[X][prelen];
    long long ans = pre + post * mul;
    if (ans >= MOD || ans <= -MOD) ans %= MOD;
    if (ans < 0) ans += MOD;
    return ans;
  }

 public:
  pair<int, int> replaceOneChar(const pair<int, int>& oldHash, int index,
                                int oldVal, int newVal) {
    pair<int, int> ans;
    ans.first =
        replaceOneChar(oldHash.first, index, oldVal, newVal, X[0], MOD[0]);
    ans.second =
        replaceOneChar(oldHash.second, index, oldVal, newVal, X[1], MOD[1]);
    return ans;
  }
  pair<int, int> pushBackCharacter(const pair<int, int>& oldHash, int index,
                                   int newVal) {
    pair<int, int> ans;
    ans.first = pushBackCharacter(oldHash.first, index, newVal, X[0], MOD[0]);
    ans.second = pushBackCharacter(oldHash.second, index, newVal, X[1], MOD[1]);
    return ans;
  }
  pair<int, int> pushFrontCharacter(const pair<int, int>& oldHash, int newVal) {
    pair<int, int> ans;
    ans.first = pushFrontCharacter(oldHash.first, newVal, X[0], MOD[0]);
    ans.second = pushFrontCharacter(oldHash.second, newVal, X[1], MOD[1]);
    return ans;
  }
  pair<int, int> mergeHash(const pair<int, int>& pre,
                           const pair<int, int>& post, int prelen) {
    pair<int, int> ans;
    ans.first = mergeHash(pre.first, post.first, prelen, X[0], MOD[0]);
    ans.second = mergeHash(pre.second, post.second, prelen, X[1], MOD[1]);
    return ans;
  }
};
template <class T>
class DynamicHash : public Hash {
 private:
  set<pair<int, int> > table;

 public:
  int size() { return table.size(); }
  bool insert(const T& s) { return table.insert(this->hash(s)).second; }
  bool find(const pair<int, int>& p) { return table.find(p) != table.end(); }
  bool find(const T& s) { return find(this->hash(s)); }
};
template <class T>
class StaticHash : public Hash {
 private:
  vector<pair<int, int> > table;
  bool isReady;

 public:
  StaticHash() { isReady = false; }
  int size() { return table.size(); }
  void insert(const T& s) {
    if (isReady == true) {
      assert(0);
    }
    table.push_back(this->hash(s));
  }
  bool find(const pair<int, int>& p) {
    if (isReady == false) {
      sort(table.begin(), table.end());
      table.erase(unique(table.begin(), table.end()), table.end());
      isReady = true;
    }
    return binary_search(table.begin(), table.end(), p);
  }
  bool find(const T& s) { return find(this->hash(s)); }
};
pair<int, int> suffixHash[3000000];
pair<int, int> prefixHash[3000000];
char str[3000001];
long long p26[3000000];
int main() {
  p26[0] = 1;
  for (int i = 1; i <= 1000001; ++i) p26[i] = (p26[i - 1] * 26) % mod;
  int n, m;
  scanf("%d%d", &n, &m);
  scanf("%s", str);
  string p(str);
  StaticHash<string> hashTable;
  for (int i = 0; i < p.size(); ++i)
    prefixHash[i + 1] = hashTable.pushBackCharacter(prefixHash[i], i, p[i]);
  for (int i = 0; i < p.size(); ++i)
    suffixHash[i + 1] =
        hashTable.pushFrontCharacter(suffixHash[i], p[p.size() - 1 - i]);
  if (m == 0) {
    cout << pwr(26, n, mod);
    return 0;
  }
  int yp;
  scanf("%d", &yp);
  long long ans = p26[yp - 1];
  --yp;
  for (int i = 1; i < m; ++i) {
    int y;
    scanf("%d", &y);
    --y;
    int st = y;
    int en = yp + p.size() - 1;
    int overLap = en - st + 1;
    if (overLap > 0) {
      if (prefixHash[overLap] != suffixHash[overLap]) {
        cout << "0";
        return 0;
      }
    } else {
      overLap *= -1;
      ans *= p26[overLap];
      ans %= mod;
    }
    yp = y;
  }
  int firstUnassigned = yp + p.size();
  int total = (n - 1) - firstUnassigned + 1;
  if (total >= 0) ans *= p26[total];
  ans %= mod;
  cout << ans;
}
