#include<bits/stdc++.h>
#define pb push_back
#define int long long
#define all(x) x.begin(),x.end()
#define pii pair<int,int> 
#define vi vector<int> 
#define FOR(i,n) for(int i=0;i<n;i++)
#define MOD 1000000007
#define fi first
#define se second
using namespace std;
void solve()
{
	int n,k;	
	cin>>n>>k;
	string s,t;
	cin>>s;
	t=s;
	if(k==0)
			{
				cout<<"YES\n";
				return;
			}
	if(n>=2*k+1)
	{
		string s1,s2;
		for(int i=0;i<k;i++)
		{
			s1+=s[i];
		}
		for(int i=n-1;i>=n-k;i--)
		{
			s2+=s[i];
		}
		// cout<<s1<<" "<<s2<<endl;
		if(s1==s2)
		cout<<"YES\n";
		else
		cout<<"NO\n";
	}
	else
	cout<<"NO\n";
}
int32_t main()
{
	ios_base::sync_with_stdio(false);cin.tie(NULL);
	//freopen("shell.in", "r", stdin);
	//freopen("shell.out", "w", stdout);
	int t=1;
	cin>>t;
	while(t--)
	{
		solve();
	}
	return 0;
}
// Problem : A. Split it!
// Contest : Codeforces - Codeforces Round #706 (Div. 2)
// URL : https://codeforces.com/contest/1496/problem/0
// Memory Limit : 256 MB
// Time Limit : 1000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

