object Main extends App {
  val n = scala.io.StdIn.readInt()
  val a = scala.io.StdIn.readLine()
  var result = 1L
  val max = 1000000000000000000L
  a.split(" ").map(_.toLong).sorted.foreach { n =>
    if (result != 0L && result != -1L) {
      if ( (result.toString.length - 1) + (n.toString.length - 1) > 18) {
        result = -1L
      } else {
        result = result * n
        // println(result)
        if (result > max) {
          result = -1L
        } else if (result < 0L) {
          result = -1L
        }
      }
    }
  }
  println(result)
}