#include <bits/stdc++.h>
inline long long int GCD(long long int a, long long int b) {
  return b == 0 ? a : GCD(b, a % b);
}
inline long long int LCM(long long int a, long long int b) {
  return a * b / GCD(a, b);
}
inline long long int ceil(long long int a, long long int b) {
  return (a % b == 0) ? a / b : a / b + 1;
}
const long long int MOD = 1e9 + 7;
using namespace std;
void solve() {
  long long int n, k, x;
  cin >> n >> k;
  vector<pair<long long int, long long int> > v;
  for (long long int i = 1; i <= n; i++) {
    cin >> x;
    v.push_back({x, i});
  }
  sort(v.begin(), v.end());
  long long int i = 0, val = 1;
  while (i < (n - 1)) {
    if ((v[i].second + 1) == v[i + 1].second && v[i].first <= v[i + 1].first) {
      i++;
      continue;
    }
    i++;
    val++;
  }
  if (val <= k) {
    cout << "YES"
         << "\n";
    return;
  }
  cout << "NO"
       << "\n";
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
