import qualified Data.ByteString.Char8 as B import qualified Data.Vector.Unboxed.Mutable as V import Data.Int (Int64) main :: IO () main = do (n, k) <- fmap toTuple $ B.getLine ds <- fmap B.words $ B.getLine vec <- V.unsafeNew n :: IO (V.IOVector Int) mapM_ ((\(i, v) -> V.unsafeWrite vec i v) . (\(i, v) -> (i, flip (-) 1 . read . B.unpack $ v))) $ zip [0..] ds result <- sortCount n k 0 vec putStrLn result toTuple :: B.ByteString -> (Int, Int64) toTuple = (\[x, y] -> (read . B.unpack $ x, read . B.unpack $ y)) . B.words sortCount :: Int -> Int64 -> Int -> V.IOVector Int -> IO (String) sortCount n k i _ | k < 0 = return "NO" | n == i = return $ if odd k then "NO" else "YES" sortCount n k i xs = do a1 <- V.unsafeRead xs i if a1 == i then sortCount n k (i + 1) xs else V.unsafeSwap xs i a1 >> sortCount n (k - 1) i xs