
const [_, inp] = require("fs").readFileSync("/dev/stdin", "utf8").split("\n");

const a = inp.split(" ").map((s) => parseInt(s, 10));

if (a.some((x)=>x===0)) {
    console.log(0);
    process.exit(0);
}

let ans = 1n;
a.forEach((n) => {
    ans = ans * BigInt(n);
})
console.log((ans > Math.pow(10, 18)) ? -1 : ans);
