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

using ll = long long;

using vi = vector<int>;
#define pb push_back
#define rsz resize
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()

using pi = pair<int,int>;
#define f first
#define s second
#define mp make_pair

const int mxn = 1e2, mxa = 1e6;

int n, k;
string s;

void solve() {
    cin >> n >> k >> s;
    
    if (k == 0) {
        cout << "YES\n";
        return;
    }

    for (int i = k; 2*i < n; ++i) {
        string s1 = s.substr(0, i), s2 = s.substr(n-i, i);
        reverse(s2.begin(), s2.end());
        if (s1 == s2) {
            cout << "YES\n";
            return;
        }
    }

    cout << "NO\n";
}

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);

    int t;
    // t = 1;
    cin >> t;
    
    while (t --> 0) solve();
}
