import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    val n = sc.nextInt()
    val a = Vector.fill(n)(BigInt(sc.nextBigInteger()))

    val l = BigInt.apply("1000000000000000000")
    if (a.contains(BigInt(0))) {
      println(0)
    } else if (a.count(_ > l) > 0) {
      println(-1)
    } else {
      println(loop(0, BigInt(1)))
    }

    def loop(i: Int, s: BigInt): BigInt = {
      if (s > l) {
        BigInt(-1)
      } else if (i >= n) {
        s
      } else {
        loop(i + 1, s * a(i.toInt))
      }
    }

  }

}
