import java.io.*;
import java.util.Locale;
import java.util.StringTokenizer;
public class TaskB {
private final InputReader reader;
private final OutputWriter writer;
public TaskB(InputReader reader, OutputWriter writer) {
this.reader = reader;
this.writer = writer;
}
public static void main
(String[] args
) { InputReader reader
= new InputReader
(System.
in); OutputWriter writer
= new OutputWriter
(System.
out); new TaskB(reader, writer).run();
writer.writer.flush();
}
public void run() {
int n = reader.nextInt();
int m = reader.nextInt();
char[] S = reader.next().toCharArray();
int k = S.length;
int[] P = new int[k + 1];
P[0] = P[1] = 0;
for (int i = 2; i <= k; i++) {
P[i] = 0;
for (int p = P[i - 1]; p != 0; p = P[p])
if (S[p] == S[i - 1]) {
P[i] = p + 1;
break;
}
if (P[i] == 0 && S[i - 1] == S[0])
P[i] = 1;
}
boolean[] good = new boolean[k + 1];
good[0] = true;
for (int p = k; p != 0; p = P[p])
good[p] = true;
int end = 0;
int ans = 1;
final int MOD = 1000 * 1000 * 1000 + 7;
for (int i = 0; i < m; i++) {
int x = reader.nextInt();
if (x > end) {
for (int j = 0; j < x - end - 1; j++)
ans = (int)((ans * 1l * 26) % MOD);
} else {
if (!good[end - x + 1])
ans = 0;
}
end = x + k - 1;
}
while (end < n) {
ans = (int) ((ans * 1l * 26) % MOD);
end++;
}
writer.printf("%d\n", ans);
}
static class InputReader {
tokenizer = null;
}
while (tokenizer == null || !tokenizer.hasMoreTokens()) {
try {
}
}
return tokenizer.nextToken();
}
public int nextInt() {
}
public double nextDouble() {
return Double.
parseDouble(next
()); }
public long nextLong() {
return Long.
parseLong(next
()); }
}
static class OutputWriter {
}
}
}
}
aW1wb3J0IGphdmEuaW8uKjsKaW1wb3J0IGphdmEudXRpbC5Mb2NhbGU7CmltcG9ydCBqYXZhLnV0aWwuU3RyaW5nVG9rZW5pemVyOwoKcHVibGljIGNsYXNzIFRhc2tCIHsKICAgIHByaXZhdGUgZmluYWwgSW5wdXRSZWFkZXIgcmVhZGVyOwogICAgcHJpdmF0ZSBmaW5hbCBPdXRwdXRXcml0ZXIgd3JpdGVyOwoKICAgIHB1YmxpYyBUYXNrQihJbnB1dFJlYWRlciByZWFkZXIsIE91dHB1dFdyaXRlciB3cml0ZXIpIHsKICAgICAgICB0aGlzLnJlYWRlciA9IHJlYWRlcjsKICAgICAgICB0aGlzLndyaXRlciA9IHdyaXRlcjsKICAgIH0KCiAgICBwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmdbXSBhcmdzKSB7CiAgICAgICAgSW5wdXRSZWFkZXIgcmVhZGVyID0gbmV3IElucHV0UmVhZGVyKFN5c3RlbS5pbik7CiAgICAgICAgT3V0cHV0V3JpdGVyIHdyaXRlciA9IG5ldyBPdXRwdXRXcml0ZXIoU3lzdGVtLm91dCk7CiAgICAgICAgbmV3IFRhc2tCKHJlYWRlciwgd3JpdGVyKS5ydW4oKTsKICAgICAgICB3cml0ZXIud3JpdGVyLmZsdXNoKCk7CiAgICB9CgogICAgcHVibGljIHZvaWQgcnVuKCkgewogICAgICAgIGludCBuID0gcmVhZGVyLm5leHRJbnQoKTsKICAgICAgICBpbnQgbSA9IHJlYWRlci5uZXh0SW50KCk7CiAgICAgICAgY2hhcltdIFMgPSByZWFkZXIubmV4dCgpLnRvQ2hhckFycmF5KCk7CiAgICAgICAgaW50IGsgPSBTLmxlbmd0aDsKICAgICAgICBpbnRbXSBQID0gbmV3IGludFtrICsgMV07CiAgICAgICAgUFswXSA9IFBbMV0gPSAwOwogICAgICAgIGZvciAoaW50IGkgPSAyOyBpIDw9IGs7IGkrKykgewogICAgICAgICAgICBQW2ldID0gMDsKICAgICAgICAgICAgZm9yIChpbnQgcCA9IFBbaSAtIDFdOyBwICE9IDA7IHAgPSBQW3BdKQogICAgICAgICAgICAgICAgaWYgKFNbcF0gPT0gU1tpIC0gMV0pIHsKICAgICAgICAgICAgICAgICAgICBQW2ldID0gcCArIDE7CiAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIGlmIChQW2ldID09IDAgJiYgU1tpIC0gMV0gPT0gU1swXSkKICAgICAgICAgICAgICAgIFBbaV0gPSAxOwogICAgICAgIH0KICAgICAgICBib29sZWFuW10gZ29vZCA9IG5ldyBib29sZWFuW2sgKyAxXTsKICAgICAgICBnb29kWzBdID0gdHJ1ZTsKICAgICAgICBmb3IgKGludCBwID0gazsgcCAhPSAwOyBwID0gUFtwXSkKICAgICAgICAgICAgZ29vZFtwXSA9IHRydWU7CiAgICAgICAgaW50IGVuZCA9IDA7CiAgICAgICAgaW50IGFucyA9IDE7CiAgICAgICAgZmluYWwgaW50IE1PRCA9IDEwMDAgKiAxMDAwICogMTAwMCArIDc7CiAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBtOyBpKyspIHsKICAgICAgICAgICAgaW50IHggPSByZWFkZXIubmV4dEludCgpOwogICAgICAgICAgICBpZiAoeCA+IGVuZCkgewogICAgICAgICAgICAgICAgZm9yIChpbnQgaiA9IDA7IGogPCB4IC0gZW5kIC0gMTsgaisrKQogICAgICAgICAgICAgICAgICAgIGFucyA9IChpbnQpKChhbnMgKiAxbCAqIDI2KSAlIE1PRCk7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICBpZiAoIWdvb2RbZW5kIC0geCArIDFdKQogICAgICAgICAgICAgICAgICAgIGFucyA9IDA7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZW5kID0geCArIGsgLSAxOwogICAgICAgIH0KICAgICAgICB3aGlsZSAoZW5kIDwgbikgewogICAgICAgICAgICBhbnMgPSAoaW50KSAoKGFucyAqIDFsICogMjYpICUgTU9EKTsKICAgICAgICAgICAgZW5kKys7CiAgICAgICAgfQogICAgICAgIHdyaXRlci5wcmludGYoIiVkXG4iLCBhbnMpOwogICAgfQoKCiAgICBzdGF0aWMgY2xhc3MgSW5wdXRSZWFkZXIgewogICAgICAgIHB1YmxpYyBCdWZmZXJlZFJlYWRlciByZWFkZXI7CiAgICAgICAgcHVibGljIFN0cmluZ1Rva2VuaXplciB0b2tlbml6ZXI7CgogICAgICAgIHB1YmxpYyBJbnB1dFJlYWRlcihJbnB1dFN0cmVhbSBzdHJlYW0pIHsKICAgICAgICAgICAgcmVhZGVyID0gbmV3IEJ1ZmZlcmVkUmVhZGVyKG5ldyBJbnB1dFN0cmVhbVJlYWRlcihzdHJlYW0pLCAzMjc2OCk7CiAgICAgICAgICAgIHRva2VuaXplciA9IG51bGw7CiAgICAgICAgfQoKICAgICAgICBwdWJsaWMgU3RyaW5nIG5leHQoKSB7CiAgICAgICAgICAgIHdoaWxlICh0b2tlbml6ZXIgPT0gbnVsbCB8fCAhdG9rZW5pemVyLmhhc01vcmVUb2tlbnMoKSkgewogICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICB0b2tlbml6ZXIgPSBuZXcgU3RyaW5nVG9rZW5pemVyKHJlYWRlci5yZWFkTGluZSgpKTsKICAgICAgICAgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHsKICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbihlKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICByZXR1cm4gdG9rZW5pemVyLm5leHRUb2tlbigpOwogICAgICAgIH0KCiAgICAgICAgcHVibGljIGludCBuZXh0SW50KCkgewogICAgICAgICAgICByZXR1cm4gSW50ZWdlci5wYXJzZUludChuZXh0KCkpOwogICAgICAgIH0KCiAgICAgICAgcHVibGljIGRvdWJsZSBuZXh0RG91YmxlKCkgewogICAgICAgICAgICByZXR1cm4gRG91YmxlLnBhcnNlRG91YmxlKG5leHQoKSk7CiAgICAgICAgfQoKICAgICAgICBwdWJsaWMgbG9uZyBuZXh0TG9uZygpIHsKICAgICAgICAgICAgcmV0dXJuIExvbmcucGFyc2VMb25nKG5leHQoKSk7CiAgICAgICAgfQogICAgfQoKICAgIHN0YXRpYyBjbGFzcyBPdXRwdXRXcml0ZXIgewogICAgICAgIHB1YmxpYyBQcmludFdyaXRlciB3cml0ZXI7CgogICAgICAgIE91dHB1dFdyaXRlcihPdXRwdXRTdHJlYW0gc3RyZWFtKSB7CiAgICAgICAgICAgIHdyaXRlciA9IG5ldyBQcmludFdyaXRlcihzdHJlYW0pOwogICAgICAgIH0KCiAgICAgICAgcHVibGljIHZvaWQgcHJpbnRmKFN0cmluZyBmb3JtYXQsIE9iamVjdC4uLiBhcmdzKSB7CiAgICAgICAgICAgIHdyaXRlci5wcmludChTdHJpbmcuZm9ybWF0KExvY2FsZS5FTkdMSVNILCBmb3JtYXQsIGFyZ3MpKTsKICAgICAgICB9CiAgICB9Cn0K