object Main extends App {

  def run(): Unit = {
    import io.StdIn._
    val _ = readLine().toInt
    val Array(a, rest @ _*) = readLine().split("\\s").map(_.toLong)
    val it = rest.iterator

    val M = 1e+18.toLong
    var n = a
    while (it.hasNext) {
      if (M < n) {
        println(-1)
        return ()
      }
      n = n * it.next
    }
    println(n)
  }

  run()
}