object Main extends App {
  val n = scala.io.StdIn.readInt()
  val a = scala.io.StdIn.readLine()
  var result = 1L
  val max = 1000000000000000000L

  val aArray = a.split(" ").map(_.toLong).sorted.foreach { n =>
    if (result != 0 && result != -1) {
      result = result * n
      if (result > max) {
        result = -1
      }
    }
  }
  println(result)
}
