#include <bits/stdc++.h>
using namespace std;
class KmpSolver {
 public:
  vector<int> getPrefixFunction(const string& s) {
    vector<int> pi(s.size());
    for (int i = 1; i < s.size(); ++i) {
      for (int j = pi[i - 1]; j > 0; j = pi[j - 1]) {
        if (s[i] == s[j]) {
          pi[i] = j + 1;
          break;
        }
      }
      if (pi[i] == 0 && s[i] == s[0]) {
        pi[i] = 1;
      }
    }
    return pi;
  }
  vector<int> getOccurrencesInT(const string& s, const string& t) {
    int sLength = s.size();
    string newString = s + "#" + t;
    vector<int> pi = getPrefixFunction(newString);
    vector<int> occurrences;
    for (int i = sLength + 1; i < newString.size(); ++i) {
      if (pi[i] == sLength) {
        int startPosition = (i - sLength + 1) - (sLength + 1);
        occurrences.push_back(startPosition);
      }
    }
    return occurrences;
  }
  vector<int> countOccurrencesPrefixes(const string& s) {
    vector<int> pi = getPrefixFunction(s);
    vector<int> occurrences(s.size() + 1, 1);
    for (int i = 0; i < s.size(); ++i) {
      ++occurrences[pi[i]];
    }
    for (int i = (int)s.size() - 1; i > 0; --i) {
      occurrences[pi[i]] += occurrences[i];
    }
    return occurrences;
  }
  long long getDifferenctSubstringsCount(const string& s) {
    long long totalSubstrings = 0;
    for (int i = 0; i < s.size(); ++i) {
      totalSubstrings += i + 1;
      string temp = s.substr(0, i + 1);
      reverse(temp.begin(), temp.end());
      vector<int> pi = getPrefixFunction(temp);
      int maxPi = *max_element(pi.begin(), pi.end());
      totalSubstrings -= maxPi;
    }
    return totalSubstrings;
  }
  string getShortestCompression(const string& s) {
    vector<int> pi = getPrefixFunction(s);
    int candidate = s.size() - pi.back();
    if (s.size() % candidate == 0) {
      return s.substr(0, candidate);
    } else {
      return s;
    }
  }
  vector<vector<int>> getAutomaton(string s) {
    s += "#";
    vector<int> pi = getPrefixFunction(s);
    vector<vector<int>> automaton(s.size(), vector<int>(26));
    for (int oldPi = 0; oldPi < s.size(); ++oldPi) {
      for (char newChar = 'a'; newChar <= 'z'; ++newChar) {
        if (oldPi == 0) {
          automaton[oldPi][newChar - 'a'] = (newChar == s[0]);
        } else {
          if (s[oldPi] == newChar) {
            automaton[oldPi][newChar - 'a'] = oldPi + 1;
          } else {
            automaton[oldPi][newChar - 'a'] =
                automaton[pi[oldPi - 1]][newChar - 'a'];
          }
        }
      }
    }
    return automaton;
  }
};
const int MOD = 1000000007;
long long FastPower(long long x, long long y) {
  if (y == 0) {
    return 1;
  }
  long long sq = FastPower(x, y / 2);
  sq *= sq;
  if (y % 2 != 0) {
    sq %= MOD;
    sq *= x;
  }
  return sq % MOD;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  string p;
  cin >> p;
  KmpSolver kmpSolver;
  vector<int> pi = kmpSolver.getPrefixFunction(p);
  vector<bool> canTakePrefix(p.size());
  for (int j = pi.back(); j > 0; j = pi[j - 1]) {
    canTakePrefix[j - 1] = true;
  }
  long long ways = 1;
  int lastStart = -1;
  for (int i = 1; i <= m; ++i) {
    int x;
    cin >> x;
    if (lastStart != -1) {
      int lastEnd = lastStart + p.size() - 1;
      if (lastEnd < x) {
        ways *= FastPower(26, x - 1 - lastEnd);
        ways %= MOD;
      } else {
        int intersecion = lastEnd - x + 1;
        if (canTakePrefix[intersecion - 1] == false) {
          ways *= 0;
        }
      }
    } else {
      ways *= FastPower(26, x - 1);
      ways %= MOD;
    }
    lastStart = x;
  }
  if (lastStart == -1) {
    ways *= FastPower(26, n);
  } else {
    ways *= FastPower(26, n - (lastStart + p.size() - 1));
    ways %= MOD;
  }
  cout << ways;
  return 0;
}
