import Data.List
import Control.Monad
f :: [Int] -> [Int]
f [x]  = [x]
f (x:y:xs) = [x*y]++f (y:xs)
main = do
 [n,k]<- map read.words<$>getLine
 s <- map read.words<$>getLine
 print$(sort(f s))!!(k-1)