import java.math.BigInteger

fun main() = Thread(null, ::abc169b, "(^o^)", 128 * 1024 * 1024).apply { start() }.join()

@OptIn(ExperimentalStdlibApi::class)
fun abc169b() {
    readLine()
    val aList = readLine()!!.split(' ').map { it.toBigInteger() }

    if (BigInteger.ZERO in aList) return println(0)

    var answer = BigInteger.ONE
    val max = BigInteger.valueOf(1000000000000000000L)

    for (a in aList) {
        answer = answer.multiply(a)
        if (answer > max) return println(-1)
    }

    println(answer)
}
