import kotlin.math.log10

fun main() {
    val n = readLine()!!.trim().toInt()
    val nums = readLine()!!.trim().split(' ').map(String::toLong)
    if (nums.contains(0)){
        println(0)
        return
    }
    val log = nums.sumByDouble { log10(it.toDouble()) }
    if (log > 18.5) {
        println(-1)
    }else {
        println(nums.reduce(Long::times).takeIf{it <= 1000000000000000000L} ?: -1)
    }
}
