
#include <bits/stdc++.h>

#define pb push_back
#define F first
#define S second

using namespace std;

typedef unsigned long long  ull;
typedef long long int       ll;
typedef long double         ld;
typedef pair<int, int>      pii;
typedef pair<int, pii>      iii;
typedef pair<ll, ll>        pll;
typedef pair<ll, pll>       lll;
typedef vector<int>         vi;
typedef vector<ll>          vll;
typedef vector<pii>         vpii;

const int OO = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const int pi = acos(-1);
const double EPS = 1e-9;

const int MAX = 2e5 + 10;
ll n , m , a[MAX] , ans ,cnt , k ;
string s ;
int main()
{

    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    #ifdef LOCAL
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif // LOCAL

    int t; cin >> t; while(t--){
        cin >> n >> k >> s ;
        if ( !k ){
            cout << "YES\n" ;
            continue ;
        }
        string tmp = s ;
        reverse( tmp.begin() , tmp.end() ) ;
        int i ;
        for ( i = 0 ; i < n/2 ;)
            if( s[i] == tmp[i] )
                i++;
        else
            break ;
//        cout << i << ' ' ;
        cout << ( i >= k && k*2<n? "YES\n" : "NO\n" ) ;
    }

}
