#include<bits/stdc++.h>
using namespace std;
// If you only do what you can do, you will never be more than you are now.

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

    int tt = 1, coo = 1;
    cin >> tt;
    while (tt--) {
        int N, K; cin >> N >> K;
        string s; cin >> s;
        bool ok = 1;
        for (int i = 0; i < K; i++) {
            ok = ok and s[i] == s[N - i - 1];
        }
        cout << (ok and 2 * K != N ? "yes" : "no") << "\n";
    }

    return 0;
}