import java.util.Scanner
import scala.util.control.Breaks

object Main extends App {
  val sc = new Scanner(System.in)
  val N = sc.nextInt
  val A = Array.fill(N)(BigInt(sc.nextLong))

  val z = if (A.contains(BigInt(0))) 0 else {
    val b = new Breaks
    var x = BigInt(1)
    b.breakable {
      for (i <- 0 until N) {
        x *= A(i)
        if (x < BigInt(0) || x > BigInt(1000000000000000000L)) {
          x = BigInt(-1)
          b.break
        }
      }
    }
    x
  }
  println(z)
}
