#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2,fma")
using namespace std;
const int INF = INT_MAX;
const int N = 2 * 1e5 + 10;
const long double eps = 1e-6;
const int mod = 998244353;
int a[N];
map<int, int> nxt;
void solve() {
  int n, k;
  cin >> n >> k;
  nxt.clear();
  for (int i = 1; i <= n; ++i) cin >> a[i];
  a[n + 1] = INF;
  for (int i = 1; i <= n; ++i) nxt[a[i]] = a[i + 1];
  sort(a + 1, a + n + 1);
  int cnt = 0, nx = nxt[a[1]];
  for (int i = 1; i <= n; ++i) {
    if (nx != a[i]) {
      ++cnt;
    }
    nx = nxt[a[i]];
  }
  if (cnt > k)
    cout << "No\n";
  else
    cout << "Yes\n";
  return;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  cin >> t;
  while (t--) solve();
  return 0;
}
