object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt()
  val as = List.fill(n)(sc.nextLong())
  if (as.contains(0)) {
    println(0)
  } else {
    var ans = 1L
    var continue = true
    for (a <- as) {
      if (continue) {
        val prev = ans
        ans *= a
        if (ans < prev || ans > 1000000000000000000L) {
          continue = false
          ans = -1
        }
      }
    }
    println(ans)
  }
}