N,K = map(int,input().split()) D = list(map(int,input().split())) m = 0 while 2**m0: cnt += T[j] j -= j&(-j) return cnt tot = 0 for i in range(N): k = D[i] tot += i-cumsum(k) plus(k,1) if tot>K: print("NO") elif (K-tot)%2==0: print("YES") else: print("NO")