#include <iostream>
using namespace std;
const int mod=19930726;
int n,k;
long long res=1;
char s[1000010];
int main () {
freopen("rehearse.in","r",stdin);
freopen("rehearse.out","w",stdout);
scanf("%d%d%s",&n,&k,s+1);
int u=n;
if (n%2==0) u--;
for (int i=u;i>=1;i-=2) {
for (int l=1;l+i-1<=n;l++) {
int r=l+i-1;
int flag=0;
for (int j=l;j<(l+r)/2;j++) {
//cout << j <<' '<< r-(j-l+1)+1 <<endl;
//cout << s[j] <<' '<< s[r-(j-l+1)+1] <<endl;
if (s[j]!=s[r-(j-l)]) {
flag=1;
break;
}
}
if (flag==0) {
k--;
res*=i;
res%=mod;
if (k==0) {
cout << res <<endl;
return 0;
}
}
}
}
cout << -1 <<endl;
return 0;
}