object Main extends App {

  def run(): Unit = {
    import io.StdIn._
    val _   = readLine().toInt
    val xs  = readLine().split("\\s").map(_.toLong)
    val M   = 1e+18.toLong

    xs.find(_ == 0) match {
      case Some(_) =>
        println(0)

      case _ =>
        val Array(x, rest @ _*) = xs
        val n = rest.foldLeft(x)((a, b) => a * b)
        
        println(if (M < n) -1 else n)
    }
  }

  run()
}