#include <bits/stdc++.h>

using namespace std;

void solve()
{
    int n,k;
    cin>>n>>k;
    string s;
    cin>>s;
    if(k==0)
    {
        cout<<"YES";
        return;
    }
    if(s.length()<(2*k+1))
    {
        cout<<"NO";
        return;
    }
   string a= s.substr(0,k);
   string b= s.substr(n-k,k);
   reverse(b.begin(),b.end());
   
   
  // cout<<endl<<a<<" "<<b<<endl;
   if(a==b)
   cout<<"YES";
   else
   cout<<"NO";
    
}
int main()
{
int t;
cin>>t;
while(t)
{
    solve();
    t-=1;
    cout<<endl;
}
   
   return 0;
}

