import java.math.BigInteger
import java.util.*

fun main() {
    val scanner = Scanner(System.`in`)
    var ans: BigInteger = BigInteger.ONE
    val limit: BigInteger = BigInteger.valueOf(1_000_000_000_000_000_000)
    val inputs = mutableListOf<BigInteger>()

    repeat(scanner.nextInt()) {
        inputs += scanner.nextBigInteger(10)
    }

    if (BigInteger.ZERO in inputs) {
        println(0)
    } else {
        for (n in inputs) {
            ans *= n

            if (ans > limit) {
                ans = BigInteger.valueOf(-1)
                break
            }
        }

        println(ans)
    }
}

