#include <bits/stdc++.h>
using namespace std;
int main() {
    int t;
    cin>>t;
    while(t--)
    {
        int n,k;
        cin>>n>>k;
        string A;
        cin>>A;
        if(n<=2*k)
        {cout<<"NO"<<endl;
        continue;
        }
      int s=0,e=A.length()-1,c=0;
        while(s<=e)
        {
            if(A[s]==A[e])
            c++;
            else
            break;
      s++;
      e--;
        }
        if(c>=k)
        cout<<"YES";
        else
        cout<<"NO";
        cout<<endl;
    }
}
