import scala.io.StdIn.{readInt, readLine}

object Main extends App {
  val Zero = BigInt(0)
  val VMax = BigInt(1_000_000_000_000_000_000L)

  val n  = readInt()
  val xs = readLine().split(' ').map { BigInt(_) }

  var isOver = false
  val s =
    if (xs.contains(Zero)) Zero
    else {
      val it = xs.iterator
      var s  = BigInt(1)
      while (it.hasNext && !isOver) {
        val a = it.next()
        s *= a
        if (s > VMax) {
          isOver = true
        }
      }
      s
    }

  println(if (isOver) -1 else s)
}
