#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
const int N = 200000;
const int M = 1000000007;

int n, k;
string s;


void solve() {
  int good = 0;
  for (int i = 0 ; i < n >> 1 ; i++) {
    if (s[i] == s[n - i - 1])
      good++;
    else
      break;
  }
  cout << (good >= k && k * 2 < n ? "YES" : "NO") << endl;


}

void read() {
  cin >> n >> k >> s;

}

signed main() {
  int t = 1;
  cin >> t;
  while (t--) {
    read();
    solve();
  }
}
