import java.math.BigDecimal

fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val a = readLine()!!.split(" ").map { it.toBigDecimal() }

    if (BigDecimal(0) in a) {
        println(0)
        return
    }

    var answer = a[0]
    val upper = BigDecimal(10).pow(18)
    for (i in 1 until n) {
        answer *= a[i]
        if (answer > upper) {
            answer = BigDecimal(-1)
            break
        }
    }

    println(answer)
}
