#include "bits/stdc++.h"
using namespace std;
#define mod 1000000007
#define pie  3.14159265
#define ll long long int
#define fr(i,a,n) for(ll i=a;i<n;i++)
#define vi vector<int>
#define vlli vector<ll>
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define fv(i,a) for(auto i:a)
#define sz(a) int((a).size())
#define all(c) (c).begin(),(c).end()
#define frv(i,c) for(auto i = c.begin(); i != c.end(); i++)

void solve()
{
	ll n, k;
	cin >> n >> k;
	string s;
	cin >> s;
	if (n >= ((2 * k) + 1))
	{
		fr(i, 0, k)
		{
			if (s[i] != s[n - 1 - i])
			{
				cout << "NO" << endl; return;
			}
		}
		cout << "YES" << endl; return;
	}
	cout << "NO" << endl; return;
}


int main() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen ("output.txt", "w", stdout);
#endif
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int t;
	cin >> t;
	//t = 1;
	while (t--)
	{
		solve();
	}


	return 0;
}