#include<bits/stdc++.h>

using namespace std;
using ll = long long;
using llu = unsigned long long;
using ld = long double;

#define CEIL(x, y) ceil((ld)x / (ld)y)

#define dbgLST(ds) for(auto it : ds) cout << it << ' ';
#define dbgMP(ds) for(auto it : ds) cout << it.first << ' ' << it.second << '\n';

const double PI = acos(-1.0), g = 9.80665;
const ll unseen = 0, pinf = 1e18 + 505, ninf = -1e18 - 505, md = 1000000007;
ll i, j, k, n, m;
bool is;  

void solve(void)
{
    cin >> n >> k;
    string s;
    cin >> s;
    if(k == 0) cout << "YES\n";
    else if(n % 2 == 0 && k == (n / 2)) cout << "NO\n";
    else {
        bool isp = 1;
        ll sz;
        for(i = 0, j = s.size() - 1; i < k; i++, j--) {
            isp &= (s[i] == s[j]);
        }
        cout << (isp ? "YES\n" : "NO\n");
    }
}

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

    int testcase = 1;
    cin >> testcase;
    while(testcase--) {
        solve();
    }    
    return 0;
}