object Main {
  def main(args: Array[String]): Unit = {
    import scala.io.StdIn.readLine
    val Array(datN) = readLine.split(" ").map(_.toInt)
    val datA_ = readLine.split(" ")
    val datA = datA_.map(_.toLong)

    if (datA.exists(_ == 0)) {
      println(0)
      return
    }

    val border = math.pow(10, 18).toLong
    var mul = 1L
    for (i <- 0 until datA.length) {
      if (mul >= 0) {
        if(math.log10(mul) + math.log10(datA(i)) > 18) {
          mul = -1
        } else {
          mul = mul * datA(i)
        }
        mul = if (mul > border) -1 else mul
      }
    }
    println(mul)
  }
}
