import java.math.BigDecimal

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

    if (aa.contains(0)) {
        println(0)
        return
    }

    var current = BigDecimal.ONE

    aa.forEach {
        current *= BigDecimal(it)

        if (current > BigDecimal(1000000000000000000)) {
            println(-1)
            return
        }
    }

    println(current)
}