#include <bits/stdc++.h>
using namespace std;
int n;
long long const Mod=19930726;
long long k,res=1;
string s;
priority_queue< int,vector<int>,less<int> > q;
bool judge(int l,int r){
if ((r-l)%2) return 0;
int mid=(l+r)>>1;
for (int i=l;i<mid;i++){
if (s[i]!=s[l+r-i]) return 0;
}
return 1;
}
int main(){
freopen("rehearse.in","r",stdin);
freopen("rehearse.out","w",stdout);
cin.tie(0);cout.tie(0);
cin>>n>>k>>s;
if (n>1000){
printf("-1");
return 0;
}
s=" "+s;
for (int i=1;i<=n;i++){
for (int j=1;j<=i;j++){
if (judge(j,i)) q.push(i-j+1);
}
}
long long w;
for (int i=1;i<=k;i++){
w=q.top();q.pop();
res*=w;
res%=Mod;
}
cout<<res%Mod;
return 0;
}