#include <algorithm>
#include <iostream>
#include <iomanip>
#include <vector>
#include <cmath>
#include <map>
#include <set>

#define all(a) a.begin(), a.end()
#define pb push_back

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

const int N = 2e5+7;

void solve() {
    int n, k; cin >> n >> k;
    string s; cin >> s;
    string t1, t2;
    for(int i = 0; i < k; ++i) t1 += s[i];
    for(int i = n - k; i < n; ++i) t2 += s[i];
    reverse(all(t1));
    if(t1 == t2 && 2*k < n) cout << "YES\n";
    else cout << "NO\n";
}

int main()
{
    ios::sync_with_stdio(0); cin.tie(0);
    int t; cin >> t;
    while(t--) solve();
    return 0;
}
