#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, k;
    cin >> n >> k;
    vector<long long> arr(n);
    for (auto &i : arr) cin >> i;
    vector<long long> sorted(arr);
    sort(sorted.begin(), sorted.end());
    int cnt = 0;
    for (int i = 0; i < n - 1; i++) {
      if (arr[i] < arr[i + 1]) {
        int ind =
            lower_bound(sorted.begin(), sorted.end(), arr[i]) - sorted.begin();
        if (sorted[ind + 1] != arr[i + 1]) cnt++;
      } else {
        cnt++;
      }
    }
    if (cnt + 1 <= k)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
