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
    val n = xs.foldLeft(1L)((acc, curr) => acc * curr)
    println(if (M < n) -1 else n)
  }

  run()
}