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

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

    if (0L in aList) return println(0)

    val cap = pow(10L, 18)

    val answer = runCatching {
        aList.fold(1L) { acc, l -> Math.multiplyExact(acc, l) }
    }.fold({ it }, { Long.MAX_VALUE }).takeIf { it <= cap } ?: -1

    println(answer)
}

private fun pow(n: Long, p: Long): Long {
    var x = n
    var y = p
    var result = 1L
    while (y > 0) {
        if (y % 2 == 1L)
            result = (result * x)
        y = y shr 1
        x = (x * x)
    }
    return result
}
