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

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