N,K = map(int,input().split()) D = list(map(int,input().split())) cnt = 0 for i in range(N): if D[i] != i + 1: cnt+=1 K -= cnt//2 if K >= 0 and K % 2 == 0: print('YES') else: print('NO')