#include <bits/stdc++.h>
using namespace std;
template<class t> inline t read(t &x){
    char c=getchar();bool f=0;x=0;
    while(!isdigit(c)) f|=c=='-',c=getchar();
    while(isdigit(c)) x=(x<<1)+(x<<3)+(c^48),c=getchar();
    if(f) x=-x;return x;
}
template<class t> inline void write(t x){
    if(x<0) putchar('-'),write(-x);
    else{if(x>9) write(x/10);putchar('0'+x%10);}
}

const int N=1e5+5;
int n,k;
char s[N];

void doit(){
	read(n);read(k);
	scanf("%s",s+1);
	if(k*2==n) return puts("NO"),void();
	for(int i=1;i<=k;i++) if(s[i]!=s[n-i+1]) return puts("NO"),void();
	puts("YES");
}

signed main(){
	int t;
	read(t);
	while(t--) doit();
}