import java.io.{BufferedReader, InputStreamReader}

import scala.collection.mutable

object Main {
  def main(args: Array[String]): Unit = {
    val in = new BufferedReader(new InputStreamReader(System.in))
    val Array(n, k) = in.readLine().split("\\s+").map(_.toInt)
    val as = in.readLine().split("\\s+").map(_.toLong).sorted

    val values = mutable.PriorityQueue.empty[(Char, Int, Int, Long)](Ordering.by[(Char, Int, Int, Long), Long](_._4).reverse)

    val plusFirstIndex = as.indexWhere(_ > 0L)
    val minusLastIndex = as.lastIndexWhere(_ < 0L)
    val notMinusLastIndex = as.lastIndexWhere(_ >= 0L)
    val notPlusFirstIndex = as.indexWhere(_ <= 0L)

    if (plusFirstIndex >= 0 && plusFirstIndex != as.length - 1) {
      values.enqueue(('A', plusFirstIndex + 1, plusFirstIndex, as(plusFirstIndex + 1) * as(plusFirstIndex)))
    }

    if (minusLastIndex >= 0 && minusLastIndex != 0) {
      values.enqueue(('B', minusLastIndex, minusLastIndex - 1, as(minusLastIndex) * as(minusLastIndex - 1)))
    }

    if (notMinusLastIndex >= 0 && notPlusFirstIndex >= 0) {
      values.enqueue(('C', notMinusLastIndex, notPlusFirstIndex, as(notMinusLastIndex) * as(notPlusFirstIndex)))
    }

    for {
      i <- 0 until (k-1)
    } {
      val (clazz, x, y, _) = values.dequeue()
      clazz match {
        case 'A' =>
          if (y == plusFirstIndex && x < as.length - 1) {
            values.enqueue(('A', x + 1, y, as(x + 1) * as(y)))
          }
          if (x > y + 1) {
            values.enqueue(('A', x, y + 1, as(x) * as(y + 1)))
          }
        case 'B' =>
          if (x == minusLastIndex && y > 0) {
            values.enqueue(('B', x, y - 1, as(x) * as(y - 1)))
          }
          if (x - 1 > y) {
            values.enqueue(('B', x - 1, y, as(x - 1) * as(y)))
          }
        case 'C' =>
          if (y == notPlusFirstIndex && x > minusLastIndex + 1) {
            values.enqueue(('C', x - 1, y, as(x - 1) * as(y)))
          }
          if (y < plusFirstIndex - 1 && x > y + 1) {
            values.enqueue(('C', x, y + 1, as(x) * as(y + 1)))
          }
      }
    }

    System.out.println(values.dequeue()._4)
  }
}
