#include<bits/stdc++.h>
#define ll long long int
using namespace std;
#define dbg(x)          cerr << #x << " = " << x << endl;
#define mod 1000000007
struct compare {
    inline bool operator()(const std::string& first,
            const std::string& second) const
    {
        return first.size() < second.size();
    }
};//compare c;std::sort(v.begin(), v.end(), c);

int main()
{
ll t;
cin>>t;
while(t--)
{
	ll n,k;
	cin>>n>>k;
//	ll y=n%2;
//	ll x=n/2;
	string s;
	cin>>s;
	ll i=0;
	ll x=0;
	while(i<k)
	{
		if(s[i]==s[n-i-1])
		{
			x++;
			i++;
		}
		else
		break;
	}
//	dbg(x)
	if(x==k && 2*k+1<=n)
	cout<<"YES"<<endl;
	else
	cout<<"NO"<<endl;
	
}
}

