object Main extends App {
  val in = new java.util.Scanner(System.in)
  val N = in.nextInt
  val As = List.fill(N)(in.nextLong)
  val Limit = BigInt(1e18.toLong)

  def product(ans: BigInt, as: List[Long]): BigInt = as match {
    case Nil => ans
    case x :: xs =>
      ans * x match {
        case a if a > Limit => BigInt(-1)
        case a => product(a, xs)
      }
  }

  println(if (As.contains(0L)) BigInt(0) else product(BigInt(1), As))
}