#include<bits/stdc++.h>
using namespace std;
#define lli long long int
#define pb push_back
int ispali(string s)
{
    int i=0,j=s.length()-1;
    bool flag=true;
    int cnt=0;
    while(i<j){
    if(s[i]==s[j]){
    i++;j--;
    cnt+=1;
    }
    else
    break;
    }
    return cnt;
}
void solve()
{
  lli n,k;
  cin>>n>>k;
  lli ans;
  ans=k+k+1;
  string s;
  cin>>s;
  if(ispali(s)>=k&&n>=ans)
  cout<<"YES";
  else
  cout<<"NO";
 return;
}
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
  lli t=1;
  cin>>t;
  while(t--)
  {
     solve();
    cout<<endl;
  }
  return 0;
}