#include <bits/stdc++.h>
using namespace std;
struct fastIO {
  inline fastIO operator>>(int& num) {
    num = 0;
    char c = getchar();
    while (c != '-' && (c < '0' || c > '9')) c = getchar();
    bool foo = 0;
    if (c == '-') {
      foo = 1;
      c = getchar();
    }
    while (c >= '0' && c <= '9') {
      num = (num << 3) + (num << 1) + c - '0';
      c = getchar();
    }
    if (foo) num = -num;
    return *this;
  }
  inline fastIO operator>>(long long& num) {
    num = 0;
    char c = getchar();
    while (c != '-' && (c < '0' || c > '9')) c = getchar();
    bool foo = 0;
    if (c == '-') {
      foo = 1;
      c = getchar();
    }
    while (c >= '0' && c <= '9') {
      num = (num << 3) + (num << 1) + c - '0';
      c = getchar();
    }
    if (foo) num = -num;
    return *this;
  }
  inline fastIO operator>>(float& num) {
    scanf("%f", &num);
    return *this;
  }
  inline fastIO operator>>(double& num) {
    scanf("%lf", &num);
    return *this;
  }
  inline fastIO operator>>(long double& num) {
    scanf("%Lf", &num);
    return *this;
  }
  inline fastIO operator>>(char& num) {
    num = getchar();
    while (num == ' ' || num == '\n') num = getchar();
    return *this;
  }
  inline fastIO operator>>(char* num) {
    int cnt = 0;
    char c = getchar();
    while (c == ' ' || c == '\n') c = getchar();
    while (c != ' ' && c != '\n') {
      num[cnt++] = c;
      c = getchar();
    }
    num[cnt] = 0;
    return *this;
  }
  inline fastIO operator>>(string& num) {
    cin >> num;
    return *this;
  }
  inline void printInt(const int& num) {
    if (num < 10) {
      putchar(num + '0');
      return;
    }
    printInt(num / 10);
    putchar((num % 10) + '0');
  }
  inline void printINT(const long long& num) {
    if (num < 10) {
      putchar(num + '0');
      return;
    }
    printINT(num / 10);
    putchar((num % 10) + '0');
  }
  inline fastIO operator<<(const int& num) {
    if (num < 0)
      putchar('-'), printInt(-num);
    else
      printInt(num);
    return *this;
  }
  inline fastIO operator<<(const long long& num) {
    if (num < 0)
      putchar('-'), printINT(-num);
    else
      printINT(num);
    return *this;
  }
  inline fastIO operator<<(const float& num) {
    printf("%.10f", num);
    return *this;
  }
  inline fastIO operator<<(const double& num) {
    printf("%.16lf", num);
    return *this;
  }
  inline fastIO operator<<(const long double& num) {
    printf("%.20Lf", num);
    return *this;
  }
  inline fastIO operator<<(const char& num) {
    putchar(num);
    return *this;
  }
  inline fastIO operator<<(const char* num) {
    for (int i = 0; num[i]; i++) putchar(num[i]);
    return *this;
  }
  inline fastIO operator<<(const string& num) {
    cout << num;
    return *this;
  }
} fio;
int Z[2000005];
int n, m;
int whr[2000005];
char s[2000005];
int main() {
  fio >> n >> m;
  fio >> (s + 1);
  int k = strlen(s + 1);
  n += k;
  for (int I = 0; I < m; I++) {
    int i;
    fio >> i;
    i += k;
    whr[i] = 1;
  }
  int l = 0, r = 0;
  int cnt = 0;
  for (int i = 2; i <= n; i++) {
    if (i <= k) {
      if (i > r) {
        if (s[i] != s[1]) {
          Z[i] = 0;
          continue;
        }
        l = i;
        r = i - 1;
        for (int j = i, k = 1; 1; j++, k++) {
          if (s[j] != s[k]) {
            break;
          }
          r = j;
        }
        Z[i] = r - l + 1;
      } else {
        int FFF = i - l + 1;
        if (Z[FFF] >= r - i + 1) {
          l = i;
          for (int j = r + 1, k = r - i + 1; 1; j++, k++) {
            if (s[j] != s[k]) {
              break;
            }
            r = j;
          }
          Z[i] = r - l + 1;
        } else {
          Z[i] = Z[FFF];
        }
      }
    } else if (whr[i] && i > r) {
      Z[i] = k;
      l = i;
      r = i + k - 1;
    } else if (i <= r) {
      int FFF = i - l + 1;
      if (Z[FFF] >= r - i + 1) {
        l = i;
        Z[i] = r - l + 1;
      } else {
        Z[i] = Z[FFF];
      }
      if (whr[i] && Z[i] != r - l + 1) {
        return printf("0"), 0;
      } else if (whr[i]) {
        r = l + k - 1;
      }
      if (whr[i]) {
      }
    } else {
      cnt++;
    }
  }
  int ans = 1;
  while (cnt--) {
    ans = ans * 26LL % 1000000007;
  }
  fio << ans << '\n';
  return 0;
}
