#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, k;
  cin >> n >> k;
  vector<pair<long long, long long>> a(n);
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    a[i] = {x, i};
  }
  sort(a.begin(), a.end());
  long long cnt = 1;
  for (int i = 1; i < n; i++) {
    if (a[i].second - a[i - 1].second == 1) {
      continue;
    } else {
      cnt++;
    }
  }
  cout << (cnt <= k ? "YES" : "NO") << endl;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
}
