import java.util.Scanner

import scala.io.StdIn._
object Main extends App {

  val n = scala.io.StdIn.readInt()
  val A = scala.io.StdIn.readLine().split(" ").map(BigInt(_))

  def solve(): BigInt = {
    val limit = BigInt(1000000000000000000L)

    if(A.contains(0)) return 0
    A.foldLeft(BigInt(1)) { (acc, num) =>
      if(acc * num > limit) return BigInt(-1)
      else acc * num
    }
  }

  println(solve())

}

