import java.util.Scanner

object Main extends App {
  val VMax = BigInt(1_000_000_000_000_000_000L)

  val sc = new Scanner(System.in)
  sc.nextInt()
  var s = BigInt(1)
  while (sc.hasNext() && s != 0) {
    val a = BigInt(sc.next())
    s *= a
  }

  println(if (s <= VMax) s else -1)
}
