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: import java.io.*;
  import java.util.*;
  
  public class Codeforce {
  
      static class Reader {
          final private int BUFFER_SIZE = 1 << 16;
          private DataInputStream din;
          private byte[] buffer;
          private int bufferPointer, bytesRead;
  
          public Reader() {
              din = new DataInputStream(System.in);
              buffer = new byte[BUFFER_SIZE];
              bufferPointer = bytesRead = 0;
          }
  
          public Reader(String file_name) throws IOException {
              din = new DataInputStream(
                      new FileInputStream(file_name));
              buffer = new byte[BUFFER_SIZE];
              bufferPointer = bytesRead = 0;
          }
  
          public String readLine() throws IOException {
              byte[] buf = new byte[64]; // line length
              int cnt = 0, c;
              while ((c = read()) != -1) {
                  if (c == '\n') {
                      if (cnt != 0) {
                          break;
                      } else {
                          continue;
                      }
                  }
                  buf[cnt++] = (byte) c;
              }
              return new String(buf, 0, cnt);
          }
  
          public int nextInt() throws IOException {
              int ret = 0;
              byte c = read();
              while (c <= ' ') {
                  c = read();
              }
              boolean neg = (c == '-');
              if (neg)
                  c = read();
              do {
                  ret = ret * 10 + c - '0';
              } while ((c = read()) >= '0' && c <= '9');
  
              if (neg)
                  return -ret;
              return ret;
          }
  
          public long nextLong() throws IOException {
              long ret = 0;
              byte c = read();
              while (c <= ' ')
                  c = read();
              boolean neg = (c == '-');
              if (neg)
                  c = read();
              do {
                  ret = ret * 10 + c - '0';
              } while ((c = read()) >= '0' && c <= '9');
              if (neg)
                  return -ret;
              return ret;
          }
  
          public double nextDouble() throws IOException {
              double ret = 0, div = 1;
              byte c = read();
              while (c <= ' ')
                  c = read();
              boolean neg = (c == '-');
              if (neg)
                  c = read();
  
              do {
                  ret = ret * 10 + c - '0';
              } while ((c = read()) >= '0' && c <= '9');
  
              if (c == '.') {
                  while ((c = read()) >= '0' && c <= '9') {
                      ret += (c - '0') / (div *= 10);
                  }
              }
  
              if (neg)
                  return -ret;
              return ret;
          }
  
          private void fillBuffer() throws IOException {
              bytesRead = din.read(buffer, bufferPointer = 0,
                      BUFFER_SIZE);
              if (bytesRead == -1)
                  buffer[0] = -1;
          }
  
          private byte read() throws IOException {
              if (bufferPointer == bytesRead)
                  fillBuffer();
              return buffer[bufferPointer++];
          }
  
          public void close() throws IOException {
              if (din == null)
                  return;
              din.close();
          }
      }
  
      static int mod = (int) (1e9 + 7);
  
      public static class pair implements Comparator<pair> {
          int x;
          int y;
  
          public pair() {
  
          }
  
          public pair(int x, int y) {
              this.x = x;
              this.y = y;
  
          }
  
          @Override
          public int compare(pair o1, pair o2) {
              return o1.y - o2.y;
          }
      }
  
      public static long modularpow(long a, long b) {
          long res = 1;
          if (b == 0)
              return res;
          else {
              while (b > 0) {
                  if (b % 2 == 1) {
                      res *= a;
                      res %= mod;
  
                  }
                  a = a * a;
                  a %= mod;
                  b /= 2;
              }
              return res % mod;
          }
      }
  
      public static int gcd(int a, int b) {
          if (b == 0)
              return a;
          else
              return gcd(b, a % b);
      }
  
      public static String binary(int a) {
          String s1 = "";
          while (a > 0) {
              s1 = a % 2 + s1;
              a /= 2;
          }
          return s1;
      }
  
      public static int Lower_Bound(long a[], int l, int r, long k) {
  
  
          while (r - l > 1) {
              int mid = l + (r - l) / 2;
              if (a[mid] <= k) l = mid;
              else
                  r = mid;
  
          }
          return l;
      }
  
      public static int Upper_Bound(int a[], int l, int r, int k) {
  
          while (r - l > 1) {
              int mid = (l + r) / 2;
              if (a[mid] <= k)
                  l = mid;
              else
                  r = mid;
          }
          return l + 1;
      }
  
      public static void main(String arg[]) throws IOException {
          BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
          int t = Integer.parseInt(br.readLine());
          StringBuilder sb = new StringBuilder();
          while (t-- > 0) {
                  String s[]=br.readLine().split(" ");
                  int n=Integer.parseInt(s[0]);
                  int k=Integer.parseInt(s[1]);
                  ArrayList<pair>ar=new ArrayList<pair>();
                  s=br.readLine().split(" ");
                  for(int i=0;i<n;i++)
                      ar.add(new pair(Integer.parseInt(s[i]),i));
                  Collections.sort(ar,(a,b)->a.x-b.x);
                  int ans=1;
                  for(int i=1;i<ar.size();i++){
  
                      if(ar.get(i).y!=ar.get(i-1).y+1)
                          ans++;
                  }
                  if(ans<=k)
                      sb.append("Yes\n");
                  else
                      sb.append("No\n");
          }
          System.out.println(sb);
      }
  }