#include <iostream>
#include <string>
using namespace std;

int t, n, k;
string s;

int main(){
	cin>>t;
	while(t--){
		cin>>n>>k;
		cin>>s;
		int cnt = 0;
		for(int i=0; i<k; i++){
			if(s[i] == s[n-i-1])
				cnt++;
			else
				break;
		}
		if(cnt>=k && 2*cnt < n)
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;
	}
	return 0;
}
