#include<bits/stdc++.h>
using namespace std;
long long n,k,sum=1;
string a;
priority_queue <long long> q;
long long jiazh(long long x,long long y){
for (long long i=x;i<=(x+y)/2;i++){
if (a[i]!=a[x+y-i]){
return 0;
}
}
if ((y-x+1)%2==1) return 1;
else return 0;
}
int main(){
freopen("rehearse.in","r",stdin);
freopen("rehearse.out","w",stdout);
scanf("%lld%lld",&n,&k);
cin>>a;
if (n>1000) printf("-1");
else{
for (long long i=0;i<n;i++){
for (long long j=i;j<n;j++){
if (jiazh(i,j)==1){
q.push(j-i+1);
}
}
}
while (q.size()&&k){
sum=sum*q.top()%19930726;
q.pop();
k--;
}
cout<<sum%19930726;
}
return 0;
}