func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 1000006, B = 1000001969;   int n, k, m, L[N], R[N];   char a[N], b[N];   long long a1[N], M[N];   set<int> Set;   int actual(int x) {     auto it = Set.lower_bound(x);     return it == Set.end() ? n + 1 : *it;   }   void hash_build(char a[], int n, long long H[]) {     for (int i = 1; i <= n; i++) H[i] = (H[i - 1] * M[1] + a[i]) % B;   }   long long hash_range(long long H[], int L, int R) {     return (H[R] - H[L - 1] * M[R - L + 1] + 1LL * B * B) % B;   }   int main() {     scanf( %d%d , &n, &k);     scanf( %s , b + 1);     m = strlen(b + 1);     for (int i = 1; i <= k; i++) {       scanf( %d , &L[i]);       R[i] = L[i] + m - 1;     }     for (int i = 1; i <= n; i++) {       a[i] =  ? ;       Set.insert(i);     }     for (int i = 1; i <= k; i++) {       for (int j = actual(L[i]); j <= R[i]; j = actual(j + 1)) {         a[j] = b[j - L[i] + 1];         Set.erase(j);       }     }     M[0] = 1;     M[1] = 2309;     for (int i = 2; i < N; i++) M[i] = M[i - 1] * M[1] % B;     hash_build(a, n, a1);     if (k) {       long long H = hash_range(a1, L[1], R[1]);       for (int i = 2; i <= k; i++)         if (hash_range(a1, L[i], R[i]) != H) {           cout << 0 << endl;           return 0;         }     }     long long P = 1;     for (int i = 1; i <= Set.size(); i++) P = P * 26 % 1000000007;     cout << P << endl;   }   