const input = require("fs").readFileSync("/dev/stdin", "utf8")
const rows = input.split("\n")
const N = parseInt(rows[0], 10)
const values = rows[1].split(" ")
var sum = BigInt(values[0]);
function multi () {
    for (var i = 1; i < N; i ++) {
        sum *= BigInt(values[i])
        if (sum > 1000000000000000000) {
            return -1
        }
    }
    return sum
}
if (values.find(value => value === '0')) {
    console.log(0)
} else {
    console.log(multi().toString().replace('n', ''))
}
