import java.math.BigDecimal
import java.util.*

fun main() {
    val sc = Scanner(System.`in`)

    val n = sc.nextInt()

    val a: MutableList<BigDecimal> = mutableListOf()
    repeat(n) {
        val ai = sc.nextBigDecimal()
        if (ai == BigDecimal.ZERO) {
            println("0")
            return
        }
        a.add(ai)
    }

    val max = BigDecimal("1000000000000000000")

    var answer: BigDecimal = BigDecimal.ONE
    a.forEach {
        answer *= it
        if (answer > max) {
            println("-1")
            return
        }
    }

    println(answer)
}
