#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi; typedef pair<int,int> pii; typedef vector<pair<int,int> > vpii;
typedef long long ll; typedef vector<long long> vl; typedef pair<long long,long long> pll;
typedef vector<pll> vpll;typedef vector<string> vs; typedef double D; typedef vector<bool> vb;
typedef pair<ll,pll> pip;
#define sz(v) int((v).size())
#define all(v) (v).begin(), (v).end()
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define sd(x) scanf("%d", &x)
#define slld(x) scanf("%I64d", &x)
#define debug(X) cerr << " --> " << #X << " = " << X << endl
#define present(c,x) ((c).find(x) != (c).end())
#define mod 1000000007LL
#define INF 2000000000LL
#define N 1123456
char p[N];
int st[N],f[N],ar[N],po[N];
int findset(int a)
{
if(st[a]==a)return a;
return st[a] = findset(a);
}
void mergeset(int a,int b)
{
if(st[a]==st[b])return;
int x = findset(a);
int y = findset(b);
st[y] = x;
}
int main()
{
int n,m;
cin>>n>>m;
cin>>p;
po[0] = 1;
for(int i=1;i<=n;++i)
{
po[i] = po[i-1]*26;
if(po[i]>=mod) po[i] %= mod;
}
int len = strlen(p);
for(int i=1;i<=m;++i)
{
cin>>ar[i];
}
sort(ar,ar+m);
f[0] = f[1] = 0;
for(int i=2;i<=len;++i)
{
for(int j=f[i-1];;j=f[j])
{
if(p[j]==p[i-1])
{
f[i] = j + 1;
break;
}
if(j==0)
{
f[i] = 0;
break;
}
}
}
for(int i=0;i<=len;++i) st[i] = i;
for(int i=0;i<=len;++i)
{
mergeset(f[i],f[f[i]]);
}
ll ans = 1;
if(ar[m]+len-1>n){printf("0\n");return 0;}
else ans = (ans*po[n-ar[m]-len+1])%mod;
int k;
for(int i=m-1;i>0;--i)
{
if(ar[i]+len-1>=ar[i+1])
{
k = ar[i]+len-ar[i+1];
if(!(st[f[len]]==st[k]&&f[len]>=k)){printf("0\n");return 0;}
}
else
{
ans = (ans*po[ar[i+1]-ar[i]-len])%mod;
}
}
ans = (ans*po[ar[1]-1])%mod;
printf("%I64d\n",ans);
return 0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