object Main extends App {

  def run(): Unit = {
    import io.StdIn._
    val _ = readLine().toInt
    val nums = readLine().split("\\s").map(_.toLong).iterator

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

  run()
}