#include <bits/stdc++.h>
using namespace std;
mt19937_64 rng(std::chrono::steady_clock::now().time_since_epoch().count());
const char nl = '\n';
const long double eps = 1e-6, pi = acos(-1);
const long long N = 1e5, mod = 1e9 + 7, inf = 1e18;
void yn(bool t) {
  if (t) {
    cout << "YES\n";
    return;
  }
  cout << "NO\n";
}
void solve() {
  long long n, k;
  cin >> n >> k;
  long long a[n];
  for (long long i = 0; i < (n); ++i) cin >> a[i];
  unordered_map<long long, long long> make_pair;
  for (long long i = 0; i < (n); ++i) {
    make_pair[a[i]] = i;
  }
  sort(a, a + n);
  long long ct = 0;
  for (long long i = 0; i < (n - 1); ++i) {
    if (make_pair[a[i + 1]] - make_pair[a[i]] != 1) {
      ct++;
    }
  }
  if (ct + 1 <= k)
    yn(1);
  else
    yn(0);
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout.precision(numeric_limits<long double>::max_digits10);
  cout << setprecision(15) << fixed;
  long long tt = 1;
  cin >> tt;
  for (long long i = 1; i <= tt; ++i) {
    solve();
  }
  return 0;
}
