#include <bits/stdc++.h>
using namespace std;
#define int long long
const int N = 10001;
signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t; cin>>t; while(t--) {
        int n,k,z,c=0; string s; cin>>n>>k>>s;
        z = (n+1)/2;
        for(int i = 0; i < z-1; ++i)
            if(s[i] == s[n-1-i]) ++c;
            else break;
        if(c >= k) cout<<"YES\n";
        else cout<<"NO\n";
    }
}