import sequtils proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "" .} proc scan(): int = while true: var k = getchar_unlocked() if k < '0' or k > '9': break else: result = 10 * result + k.ord - '0'.ord let n = scan() let k = scan() var D = newSeqWith(n,scan()) var swapTime = 0 block: var i = 0 while i < D.len: if D[i]-1 == i : i += 1 else: swap(D[D[i]-1],D[i]) swapTime += 1 if swapTime > k : echo "NO" elif (k-swapTime) mod 2 == 0: echo "YES" else: echo "NO"