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 javax.print.attribute.IntegerSyntax;
  
  import java.io.*;
  import java.lang.reflect.Array;
  import java.math.BigInteger;
  import java.util.*;
  public class Main {
     static class Edge{
      	int start;
      	int end;
      	Edge(int start,int end)
  		{
  			this.start = start;
  			this.end = end;
  		}
  	}
  	static boolean[] primecheck = new boolean[1000002];
  	static ArrayList<Long> lucky = new ArrayList<>();
  
  	public static void main(String[] args) throws IOException {
  		OutputStream outputStream = System.out;
  		FastReader in = new FastReader();
  		PrintWriter out = new PrintWriter(outputStream);
  		PROBLEM solver = new PROBLEM();
             int t = in.nextInt();
             while(t-->0) {
  			   solver.solve(in, out);
  		   }
  		  out.close();
  	}
  
  	public static void luckIsCalling(long n){
  
  		long a = n*10 + 4;
  		long b = n*10 + 7;
  
  		lucky.add(a);
  		lucky.add(b);
  
  		if(a<=4444444444L) luckIsCalling(a);
  		if(b<=4444444444L) luckIsCalling(b);
  	}
  
  	static class PROBLEM {
  		public void solve(FastReader sc, PrintWriter out) {
  			int n = sc.nextInt();
  			 int arr[] = new int[n];
  			int brr[] = new int[n];
  			int k = sc.nextInt();
  			HashMap<Integer,Integer> map = new HashMap<>();
  			for(int i=0;i<n;i++)
  			{
  				int x = sc.nextInt();
  				map.put(x,i);
  				arr[i]=x;
  				brr[i]=x;
  			}
  			Arrays.sort(arr);
  			 int i=0;
  			 int count=0;
  			 while(i<n)
  			 {
  			 	int j = map.get(arr[i]);
  			 	int idx = i;
  			 	while(j<n)
  				{
  					if(idx<n&&j<n&&arr[idx]==brr[j])
  					{
  						j++;
  						idx++;
  					}
  					else break;
  				}
  			 	count++;
  			 	i = idx;
  			 }
  			if(count<=k)
  			{
  				System.out.println("YES");
  			}
  			else
  			{
  				System.out.println("NO");
  			}
  		}
  		}
  		static int helper(ArrayList<Integer> lt ,int k)
  		{
  			int arr[] = new int[lt.size()];
  			arr[0]=lt.get(0);
  			for(int i=1;i<k&&i<arr.length;i++)
  			{
  				arr[i]=arr[i-1]+lt.get(i);
  			}
  			for(int i=k;i<arr.length;i++)
  			{
  				arr[i] = arr[i-1]+lt.get(i)-arr[i-k];
  			}
  			Arrays.sort(arr);
  			return arr[arr.length-1];
  		}
  
  
  
  		static boolean isPalindrome(char[] s) {
  			int flag = 1;
  			for (int i = 0; i < s.length; i++) {
  				if (s[i] != s[s.length - 1 - i]) {
  					flag = 0;
  					break;
  				}
  			}
  			if (flag == 1) return true;
  			else return false;
  		}
  
  		static long gcd(long a, long b) {
  			if (b == 0) return a;
  			return gcd(b, a % b);
  		}
  
  		static boolean isSquare(double a) {
  			boolean isSq = false;
  			double b = Math.sqrt(a);
  			double c = Math.sqrt(a) - Math.floor(b);
  
  			if (c == 0) isSq = true;
  
  			return isSq;
  		}
  
  		static int exponentMod(int A, int B, int C) {
  
  			// Base cases
  			if (A == 0)
  				return 0;
  			if (B == 0)
  				return 1;
  
  			// If B is even
  			long y;
  			if (B % 2 == 0) {
  				y = exponentMod(A, B / 2, C);
  				y = (y * y) % C;
  			}
  
  			// If B is odd
  			else {
  				y = A % C;
  				y = (y * exponentMod(A, B - 1,
  						C) % C) % C;
  			}
  
  			return (int) ((y + C) % C);
  		}
  
  		public static class Pair<U extends Comparable<U>, V extends Comparable<V>> implements Comparable<Pair<U, V>> {
  			public U x;
  			public V y;
  
  			public Pair(U x, V y) {
  				this.x = x;
  				this.y = y;
  			}
  
  			public int hashCode() {
  				return (x == null ? 0 : x.hashCode() * 31) + (y == null ? 0 : y.hashCode());
  			}
  
  			public boolean equals(Object o) {
  				if (this == o)
  					return true;
  				if (o == null || getClass() != o.getClass())
  					return false;
  				Pair<U, V> p = (Pair<U, V>) o;
  				return (x == null ? p.x == null : x.equals(p.x)) && (y == null ? p.y == null : y.equals(p.y));
  			}
  
  			public int compareTo(Pair<U, V> b) {
  				int cmpU = x.compareTo(b.x);
  				return cmpU != 0 ? cmpU : y.compareTo(b.y);
  			}
  
  			public String toString() {
  				return String.format("(%s, %s)", x.toString(), y.toString());
  			}
  
  		}
  
  		static class FastReader {
  			BufferedReader br;
  			StringTokenizer st;
  
  			public FastReader() {
  				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());
  			}
  
  			char nextChar() {
  				return next().charAt(0);
  			}
  
  			boolean nextBoolean() {
  				return !(nextInt() == 0);
  			}
  			// boolean nextBoolean(){return Boolean.parseBoolean(next());}
  
  			String nextLine() {
  				String str = "";
  				try {
  					str = br.readLine();
  				} catch (IOException e) {
  					e.printStackTrace();
  				}
  				return str;
  			}
  
  			public int[] readArray(int size) {
  				int[] array = new int[size];
  				for (int i = 0; i < size; i++) array[i] = nextInt();
  				return array;
  			}
  
  		}
  
  		private static int[] mergeSort(int[] array) {
  
  			if (array.length <= 1) {
  				return array;
  			}
  
  			int midpoint = array.length / 2;
  
  			int[] left = new int[midpoint];
  			int[] right;
  
  			if (array.length % 2 == 0) {
  				right = new int[midpoint];
  			} else {
  				right = new int[midpoint + 1];
  			}
  
  			for (int i = 0; i < left.length; i++) {
  				left[i] = array[i];
  			}
  
  			for (int i = 0; i < right.length; i++) {
  				right[i] = array[i + midpoint];
  			}
  
  			int[] result = new int[array.length];
  
  			left = mergeSort(left);
  			right = mergeSort(right);
  
  			result = merge(left, right);
  
  			return result;
  		}
  
  		private static int[] merge(int[] left, int[] right) {
  
  			int[] result = new int[left.length + right.length];
  			int leftPointer = 0, rightPointer = 0, resultPointer = 0;
  
  			while (leftPointer < left.length || rightPointer < right.length) {
  
  				if (leftPointer < left.length && rightPointer < right.length) {
  
  					if (left[leftPointer] < right[rightPointer]) {
  						result[resultPointer++] = left[leftPointer++];
  					} else {
  						result[resultPointer++] = right[rightPointer++];
  					}
  				} else if (leftPointer < left.length) {
  					result[resultPointer++] = left[leftPointer++];
  				} else {
  					result[resultPointer++] = right[rightPointer++];
  				}
  			}
  			return result;
  		}
  
  		public static void Sieve(int n) {
  
  			Arrays.fill(primecheck, true);
  			primecheck[0] = false;
  			primecheck[1] = false;
  
  			for (int i = 2; i * i < n + 1; i++) {
  				if (primecheck[i]) {
  					for (int j = i * 2; j < n + 1; j += i) {
  						primecheck[j] = false;
  					}
  				}
  			}
  		}
  
  	}
  
  
  