#include <bits/stdc++.h>   using namespace std;   int n, m, f[1000010], a[1000010];   char s[1000010];   bool vis[1000010];   long long Pow(int x) {     if (x < 0) return 0;     if (x == 0) return 1;     long long ans = Pow(x >> 1);     ans = ans * ans % 1000000007ll;     if (x & 1) ans = (ans * 26ll) % 1000000007ll;     return ans;   }   long long ans;   int main() {     scanf( %d%d , &n, &m);     if (m == 0) {       printf( %lld n , Pow(n));       return 0;     }     scanf( %s , s);     int len = strlen(s);     for (int i = 1, j; i < len; i++) {       for (j = f[i]; j && s[i] != s[j]; j = f[j])         ;       f[i + 1] = s[i] == s[j] ? j + 1 : 0;     }     for (int i = f[len]; i; i = f[i]) vis[len - i] = true;     scanf( %d , &a[1]);     a[1]--;     ans = Pow(a[1]);     for (int i = 2; i <= m; i++) {       scanf( %d , &a[i]);       a[i]--;       if (a[i] - a[i - 1] < len) {         if (!vis[a[i] - a[i - 1]]) {           printf( 0 );           return 0;         }       } else         ans = (ans * Pow(a[i] - a[i - 1] - len)) % 1000000007ll;     }     printf( %lld n , ans * Pow(n - a[m] - len) % 1000000007ll);     return 0;   }   