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

#define int long long
#define f first
#define s second
#define endl '\n'

void solve()
{
    int n,k;
    cin >> n >> k;
    string s;
    cin >> s;
    int x=0;
    while (n-x-1>x && s[x]==s[n-x-1])x++;
    if (x>=k && k*2!=n)cout << "YES" << endl;
    else cout << "NO" << endl;
}


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

    int n;
    cin >> n;
    while (n--){
        solve();
    }
}
