#include <iostream>
#include <vector>

using namespace std;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int tests;
	cin >> tests;
	
	int n, k, r;
	string s;

	for (int test = 0; test < tests; test++) {
		cin >> n >> k >> s;
		r = 0;
		while (s[r] == s[n - r - 1] && r < k){
			r += 1;
		}
		if (r >= k && n != 2 * k)
			cout << "YES\n";
		else cout << "NO\n";
	}
}
