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: /**
   * @author -- Sourav Joshi
   */
  
  import java.util.*;
  import static java.lang.Math.max;
  import static java.lang.Math.min;
  import static java.lang.Math.abs;
  import static java.lang.Math.ceil;
  import static java.lang.Math.max;
  import static java.lang.Math.pow;
  import java.io.*;
  
  public class Codechef {
  
  	static FastScanner s = new FastScanner();
  	static FastWriter out = new FastWriter();
  	final static long mod = 1000000000 + 7;
  	final static int INT_MAX = Integer.MAX_VALUE;
  	final static int INT_MIN = Integer.MIN_VALUE;
  	final static long LONG_MAX = Long.MAX_VALUE;
  	final static long LONG_MIN = Long.MIN_VALUE;
  	final static double DOUBLE_MAX = Double.MAX_VALUE;
  	final static double DOUBLE_MIN = Double.MIN_VALUE;
  	final static float FLOAT_MAX = Float.MAX_VALUE;
  	final static float FLOAT_MIN = Float.MIN_VALUE;
  
  
  	static class Pair<T,R>{
  		T first;
  		R Second;
  	}
  
  	static class FastScanner{
  		BufferedReader br;
  		StringTokenizer st;
  
  		public FastScanner() {
  			br = new BufferedReader(new InputStreamReader(System.in));
  		}
  
  		String next(){
  			while (st == null || !st.hasMoreElements()){
  				try{
  					st = new StringTokenizer(br.readLine());
  				}catch (IOException  e){
  					e.printStackTrace();
  				}
  			}
  			return st.nextToken();
  		}
  		int nextInt(){
  			return Integer.parseInt(next());
  		}
  		long nextLong(){
  			return Long.parseLong(next());
  		}
  
  		double nextDouble(){
  			return Double.parseDouble(next());
  		}
  		String nextLine(){
  			String str = "";
  			try{
  				str = br.readLine();
  			}
  			catch (IOException e){
  				e.printStackTrace();
  			}
  			return str;
  		}
  	}
  
  	static class FastWriter{
  		private final BufferedWriter bw;
  
  		public FastWriter() {
  			this.bw = new BufferedWriter(new OutputStreamWriter(System.out));
  		}
  
  		public void print(Object object) throws IOException{
  			bw.append(""+ object);
  		}
  
  		public void println(Object object) throws IOException{
  			print(object);
  			bw.append("\n");
  		}
  
  		public void close() throws IOException{
  			bw.close();
  		}
  	}
  
  	public static void main(String[] args) throws IOException {
  		int test = s.nextInt();
  		while(test-->0) {
  			int n = s.nextInt();
  			int k = s.nextInt();
  			HashMap<Integer, Integer> map = new HashMap<>();
  			int arr[] = new int[n];
  			for(int i = 0; i < n; i++) {
  				arr[i] = s.nextInt();
  				map.put(arr[i], i);
  			}
  			int temp[] = new int[n];
  			for(int i = 0; i < n; i++) {
  				temp[i] = arr[i];
  			}
  			Arrays.sort(temp);
  			int prev = temp[0];
  			int pi = map.get(prev);
  			int count = 1;
  			for(int i = 1; i < n; i++) {
  				int ci = map.get(temp[i]);
  				if(ci != pi+1) {
  					count++;
  				}
  				pi = ci;
  			}
  //			System.out.println(count);
  			if(k >= count) {
  				out.println("Yes");
  			}else {
  				out.println("No");
  			}
  		}
  		out.close();
  	}
  
  	public static long gcd(long a, long b){
  		if(a > b)
  			a = (a+b)-(b=a);
  		if(a == 0L)
  			return b;
  		return gcd(b%a, a);
  	}
  
  	public static boolean isPrime(long n){
  		if(n < 2) return false;
  		if(n == 2 || n == 3) return true;
  		if(n%2 == 0 || n%3 == 0) return false;
  		long sqrtN = (long)Math.sqrt(n)+1;
  		for(long i = 6L; i <= sqrtN; i += 6) {
  			if(n%(i-1) == 0 || n%(i+1) == 0) return false;
  		}
  		return true;
  	}
  
  	public static ArrayList<Integer> findDiv(int N){
  		//gens all divisors of N
  		ArrayList<Integer> ls1 = new ArrayList<Integer>();
  		ArrayList<Integer> ls2 = new ArrayList<Integer>();
  		for(int i=1; i <= (int)(Math.sqrt(N)+0.00000001); i++)
  			if(N%i == 0)
  			{
  				ls1.add(i);
  				ls2.add(N/i);
  			}
  		Collections.reverse(ls2);
  		for(int b: ls2)
  			if(b != ls1.get(ls1.size()-1))
  				ls1.add(b);
  		return ls1;
  	}
  
  	public static long power(long x, long y, long p){
  		//0^0 = 1
  		long res = 1L;
  		x = x%p;
  		while(y > 0)
  		{
  			if((y&1)==1)
  				res = (res*x)%p;
  			y >>= 1;
  		x = (x*x)%p;
  		}
  		return res;
  	}
  
  	public static void printintarr(int[] arr) {
  		for(int i = 0; i < arr.length; i++) {
  			System.out.print(arr[i]+" ");
  		}
  	}
  
  	public static void printlongarr(long[] arr) {
  		for(int i = 0; i < arr.length; i++) {
  			System.out.print(arr[i]+" ");
  		}
  	}
  
  	public static void printdoublearr(double[] arr) {
  		for(int i = 0; i < arr.length; i++) {
  			System.out.print(arr[i]+" ");
  		}
  	}
  
  	public static void printintarr(int arr[][]) {
  		for(int i = 0 ; i < arr.length; i++) {
  			for(int j = 0; j < arr[0].length; j++) {
  				System.out.print(arr[i][j]+" ");
  			}
  			System.out.println();
  		}
  	}
  
  	public static void printlongarr(long arr[][]) {
  		for(int i = 0 ; i < arr.length; i++) {
  			for(int j = 0; j < arr[0].length; j++) {
  				System.out.print(arr[i][j]+" ");
  			}
  			System.out.println();
  		}
  	}
  
  	public static void printdoublearr(double arr[][]) {
  		for(int i = 0 ; i < arr.length; i++) {
  			for(int j = 0; j < arr[0].length; j++) {
  				System.out.print(arr[i][j]+" ");
  			}
  			System.out.println();
  		}
  	}
  
  	public static void takeintarr(int arr[]) {
  		for(int i = 0; i < arr.length; i++) {
  			arr[i] = s.nextInt();
  		}
  	}
  
  	public static void takeintarr(int arr[][]) {
  		for(int i = 0 ; i < arr.length; i++) {
  			for(int j = 0; j < arr[0].length; j++) {
  				arr[i][j] = s.nextInt();
  			}
  		}
  	}
  }