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

int main(){
    int t;
    cin >> t;
    while(t--){
        int n, k;
        cin >> n >> k;
        string str;
        cin >> str;
        int i;
        for(i = 0; i < n - i - 1; i++){
            if(str[i] != str[n - i - 1]) break;
        }
        if(i > n - i - 1) i--;
        if(k <= i){
            cout << "YES" << endl;
        }else{
            cout << "NO" << endl;
        }
    }
    return 0;
}