import Data.List

getas k | even k = map (\x -> (read x)) . words <$> getLine :: IO [Integer]
        | otherwise = map (\x -> abs (read x)) . words <$> getLine :: IO [Integer]

main = do
    [n,k] <- map read . words <$> getLine :: IO [Int]
    as <- reverse . sort <$> (getas k)
    print $ product $ take (k) as