
#include <bits/stdc++.h>
#include<algorithm>
using namespace std;
#define int               long long int
#define vi                vector<int>
#define pb                push_back
#define ppb               pop_back
#define pf                push_front
#define ppf               pop_front
#define all(x)            (x).begin(),(x).end()
#define uniq(v)           (v).erase(unique(all(v)),(v).end())
#define sz(x)             (int)((x).size())
#define fr                first
#define sc                second
#define pii               pair<int,int>
#define rep(i,a,b)        for(i=a;i<b;i++)
void solve(){
    int n,k,i=0;
    string s;
    cin>>n>>k;
    cin>>s;
    while((n%2==0 && i<(n-2)/2) || (n%2!=0 && i<n/2)){
        if(s[i]!=s[n-i-1])
        break;
        i++;
    }
    if(i>=k)
    cout<<"YES"<<endl;
    else
    cout<<"NO"<<endl;
}

signed main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	int t;
	cin>>t;
	while(t--)
	solve();
	return 0;
}

