#include<iostream>
#include<cstring>
#include<algorithm>
#include<cstdio>
using namespace std;
const int N=1e5+7;
char a[N];
int t,n,k;

int main()
{
	scanf("%d",&t);
	while(t--)
	{
		scanf("%d%d",&n,&k);
		scanf("%s",a);
		if(k==0)
		{
			printf("YES\n");
			continue;
		}
		
		int res=0;
		if(n%2==1)
		{
			for(int i=0;i<n/2;i++)
			{
				if(a[i]!=a[n-i-1]) break;
				else res++;
			}
			if(res>=k) printf("YES\n");
			else printf("NO\n");
		}
		else
		{
			for(int i=0;i<n/2-1;i++)
			{
				if(a[i]!=a[n-i-1]) break;
				else res++;
			}
			if(res>=k) printf("YES\n");
			else printf("NO\n");
		}
		
	}
}