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 cp
  {
  	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();
  		}
  	}
  
  	public static int binarySearch(int[] arr, int ele) {
  		int s = 0;
  		int e = arr.length - 1;
  		
  		while(s <= e) {
  			int mid = (s + e)/2;
  			if(arr[mid] < ele) {
  				s = mid + 1;
  			}else if(arr[mid] > ele) {
  				e = mid - 1;
  			}else {
  				return mid;
  			}
  		}
  		return -1;
  	}
  	
  	public static void main(String[] args) throws IOException
  	{
  		try{
  			//Your Solve
  			Reader s = new Reader();
  //			Scanner s = new Scanner(System.in);
  			int t = s.nextInt();
  			for(int p = 0;p < t;p++) {
  				int n = s.nextInt();
  				int k = s.nextInt();
  				int arr[] = new int[n];
  				int sort[] = new int[n];
  				for(int i = 0;i < n;i++) {
  					arr[i] = s.nextInt();
  					sort[i] = arr[i];
  				}
  				Arrays.sort(sort);
  				int count = 0;
  				for(int i = 0;i < n-1;i++) {
  					int index = binarySearch(sort,arr[i]);
  					if(index == n-1) {
  						continue;
  					}else {
  						if(arr[i+1] == sort[index+1]) {
  							count++;
  //							System.out.println(i);
  						}
  					}
  				}
  //				System.out.println(count);
  				if(k >= (n-count)) {
  					System.out.println("Yes");
  				}else {
  					System.out.println("No");
  				}
  				
  				
  			}
  
  
  		}catch(Exception e){
  			return;
  		}
  	}
  }