func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long MOD = 1e9 + 7;   long long n, m;   string p, s;   vector<int> pos;   long long exp(long long a, long long x) {     if (x == 0) return 1;     long long tmp = exp(a, x / 2);     tmp *= tmp;     tmp %= MOD;     if (x % 2) tmp *= a;     tmp %= MOD;     return tmp;   }   bool z(string str) {     int n = (int)str.length();     vector<int> z(n);     for (int i = 1, l = 0, r = 0; i < n; ++i) {       if (i <= r) z[i] = min(r - i + 1, z[i - l]);       while (i + z[i] < n && str[z[i]] == str[i + z[i]]) ++z[i];       if (i + z[i] - 1 > r) l = i, r = i + z[i] - 1;     }     for (int i = 0; i < pos.size(); ++i) {       if (z[pos[i] + p.size() + 1] != p.size()) return false;     }     return true;   }   int main() {     cin >> n >> m >> p;     pos.assign(m, 0);     for (int i = 0; i < m; ++i) {       cin >> pos[i];       pos[i]--;     }     sort(pos.begin(), pos.end());     for (int i = 0; i < m; ++i) {       while (s.size() < pos[i]) s +=  . ;       int stp = s.size();       for (int j = stp - pos[i]; j < p.size(); ++j) {         s += p[j];       }     }     while (s.size() < n) s +=  . ;     s = p +  #  + s;     if (z(s)) {       int cnt = 0;       for (auto i : s) cnt += i ==  . ;       cout << exp(26, cnt);     } else       cout << 0;     return 0;   }   