object Main extends App {
  @scala.annotation.tailrec
  def loop(acc: BigInt, list: List[BigInt]): BigInt =
    list match {
      case _ if 1000000000000000000L < acc => -1
      case Seq() => acc
      case x :: xs => loop(acc * x, xs)
    }

  val sc = new java.util.Scanner(System.in)
  val list@x :: xs = List.fill(sc.nextInt())(BigInt(sc.nextBigInteger()))
  println(if (list.contains(0)) 0 else loop(x, xs))
}
