description: Moamen has an array of n distinct integers. He wants to sort that array in non-decreasing order by doing the following operations in order exactly once:
  
    1. Split the array into exactly k non-empty subarrays such that each element belongs to exactly one subarray. 
    2. Reorder these subarrays arbitrary. 
    3. Merge the subarrays in their new order. 
  
  
  
  A sequence a is a subarray of a sequence b if a can be obtained from b by deletion of several (possibly, zero or all) elements from the beginning and several (possibly, zero or all) elements from the end.
  
  Can you tell Moamen if there is a way to sort the array in non-decreasing order using the operations written above?
  
  Input
  
  The first line contains a single integer t (1 ≤ t ≤ 10^3) — the number of test cases. The description of the test cases follows.
  
  The first line of each test case contains two integers n and k (1 ≤ k ≤ n ≤ 10^5).
  
  The second line contains n integers a_1, a_2, …, a_n (0 ≤ |a_i| ≤ 10^9). It is guaranteed that all numbers are distinct.
  
  It is guaranteed that the sum of n over all test cases does not exceed 3⋅10^5.
  
  Output
  
  For each test case, you should output a single string.
  
  If Moamen can sort the array in non-decreasing order, output "YES" (without quotes). Otherwise, output "NO" (without quotes).
  
  You can print each letter of "YES" and "NO" in any case (upper or lower).
  
  Example
  
  Input
  
  
  3
  5 4
  6 3 4 2 1
  4 2
  1 -4 0 -2
  5 1
  1 2 3 4 5
  
  
  Output
  
  
  Yes
  No
  Yes
  
  Note
  
  In the first test case, a = [6, 3, 4, 2, 1], and k = 4, so we can do the operations as follows: 
  
    1. Split a into \{ [6], [3, 4], [2], [1] \}. 
    2. Reorder them: \{ [1], [2], [3,4], [6] \}. 
    3. Merge them: [1, 2, 3, 4, 6], so now the array is sorted. 
  
  
  
  In the second test case, there is no way to sort the array by splitting it into only 2 subarrays.
  
  As an example, if we split it into \{ [1, -4], [0, -2] \}, we can reorder them into \{ [1, -4], [0, -2] \} or \{ [0, -2], [1, -4] \}. However, after merging the subarrays, it is impossible to get a sorted array.
solution: 
  
  /*
   * To change this license header, choose License Headers in Project Properties.
   * To change this template file, choose Tools | Templates
   * and open the template in the editor.
   */
  import java.io.BufferedReader;
  import java.io.IOException;
  import java.io.InputStreamReader;
  import java.io.PrintWriter;
  import java.util.ArrayList;
  import java.util.Collections;
  import java.util.List;
  import java.util.StringTokenizer;
  import java.util.TreeMap;
  
  /**
   *
   * @author is2ac
   */
  public class B_CF {
  
      public static void main(String[] args) {
          FastScanner56 fs = new FastScanner56();
          PrintWriter pw = new PrintWriter(System.out);
          int t = fs.ni();
          //int t = 1;
          for (int tc = 0; tc < t; tc++) {
             TreeMap<Integer,Integer> map = new TreeMap();
             int n = fs.ni(), k = fs.ni()-1;
             int[] a = fs.intArray(n);
             int p = -1, v = (int)(-1e9)-10;
             for (int i = 0; i < n; i++) {
              map.put(a[i],i);   
             }
             List<Integer> list = new ArrayList();
             for (int i = 0; i < n; i++) {
                 list.add(a[i]);
             }
             Collections.sort(list);
             for (int i = 1; i < list.size(); i++) {
                 if (map.get(list.get(i))!=map.get(list.get(i-1))+1) k--;
             }
             if (k<0) {
                 pw.println("No");
             } else {
                 pw.println("Yes");
             }
          }
          pw.close();
      }
      public static boolean recur(int bp, int ap, int d, String a, String b) {
          if (bp>=b.length()) return true;
          boolean flag = false;
          if (d==1) {
              if (ap<a.length()-1 && a.charAt(ap+1)==b.charAt(bp) && recur(bp+1,ap+1,1,a,b)) {
                  flag = true;
              }
              if (ap>0 && a.charAt(ap-1)==b.charAt(bp) && recur(bp+1,ap-1,-1,a,b)) {
                  flag = true;
              }
          } else {
              if (ap>0 && a.charAt(ap-1)==b.charAt(bp) && recur(bp+1,ap-1,-1,a,b)) {
                  flag = true;
              }
          }
          return flag;
      }
      public static boolean check(int i, int j, int[] x, int[] y, int[][] a) {
          boolean flag = true;
          for (int k = 0; k < 8; k++) {
              int r = i+y[k], c = j+x[k];
              if (r>-1&&c>-1&&r<a.length&&c<a[r].length) {
                  if (a[r][c]==1) flag = false;
              }
          }
          return flag;
      }
      public static int f(long n, long ind, long l, long r) {
          while (l < r && n > 1) {
              long m = (r + l) / 2;
              if (m == ind) {
                  break;
              }
              if (ind < m) {
                  r = m - 1;
              } else {
                  l = m + 1;
              }
              n /= 2;
          }
          return (int) (n % 2);
      }
  
      public static List<Integer> primeFactors(int number) {
          int n = number;
          List<Integer> factors = new ArrayList<Integer>();
          for (int i = 2; i <= n; i++) {
              while (n % i == 0) {
                  factors.add(i);
                  n /= i;
              }
          }
          return factors;
      }
  
      // 0 = alice, 1 = bob;
      public static int gcd(int n1, int n2) {
          if (n2 == 0) {
              return n1;
          }
          return gcd(n2, n1 % n2);
      }
  
      static boolean isp(int x) {
          int y = (int) Math.sqrt(x);
          if (Math.pow(y, 2) == x) {
              return true;
          }
          return false;
      }
  }
  
  class FastScanner56 {
  
      BufferedReader br;
      StringTokenizer st;
  
      public FastScanner56() {
          br = new BufferedReader(new InputStreamReader(System.in), 32768);
          st = null;
      }
  
      String next() {
          while (st == null || !st.hasMoreElements()) {
              try {
                  st = new StringTokenizer(br.readLine());
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }
          return st.nextToken();
      }
  
      int ni() {
          return Integer.parseInt(next());
      }
  
      int[] intArray(int N) {
          int[] ret = new int[N];
          for (int i = 0; i < N; i++) {
              ret[i] = ni();
          }
          return ret;
      }
  
      long nl() {
          return Long.parseLong(next());
      }
  
      long[] longArray(int N) {
          long[] ret = new long[N];
          for (int i = 0; i < N; i++) {
              ret[i] = nl();
          }
          return ret;
      }
  
      double nd() {
          return Double.parseDouble(next());
      }
  
      String nextLine() {
          String str = "";
          try {
              str = br.readLine();
          } catch (IOException e) {
              e.printStackTrace();
          }
          return str;
      }
  }
  