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


int main(){
	int t;
	cin >> t;
	for (int i = 0; i < t; i++){
		int n, k;
		string s;
		cin >> n >> k;
		cin >> s;
		int j=0;
		while (s[j] == s[n - j - 1] && j<=n/2)j++;
		
		if (j >= k && n!=2*k)cout << "yes"<<endl;
		else cout << "no"<<endl;
	}
	
	return 0;
}