tp

🧩 Syntax:
input format:
the input shall consists of two lines, the first line consists of two integers n, the length of array, and the Integer k.
 the second line consists of N integers

output format:
you should output a single string if array can be sorted in non decreasing order output yes otherwise output no


e.g:
input:
5  4
6 3 4 2 1


output: 
YES

explanation:
in the given test case, a=[6, 3, 4, 2, 1] & k=4, so we can do the operation as follows:
1. split a into {[6],[3,4],[2],[1]}
2. reoder them: {[1],[2],[3,4],[6]}
3. merge them:[1,2,3,4,6], so now the array is sorted.
Hence print "YES"




function solution(arr,n,k){
//write your code here
}