//g++  5.4.0

#include<bits/stdc++.h>
using namespace std;

#define ff first
#define ss second
#define int long long
#define pb push_back
#define pii pair< int,int >
#define fast ios::sync_with_stdio(0) , cin.tie(0) , cout.tie(0) ;

bool go(string s,int k)
{
    int n= s.size();
    for(int i=0 ; i<k ; i++ )
    {
        if( s[i] != s[n-1-i]) return 0;
    }
    return 1;
}
signed main()
{
    fast;
    int t;
    cin >> t;
    while( t-- )
    {
        int n,  k;
        cin >> n >> k;
        string s;
        cin >> s;
        if( go(s,k) && k*2+1 <= n) cout << "YES\n";
        else cout << "NO\n";
    }
    
}



