const input = require('fs').readFileSync('/dev/stdin', 'utf8').split('\n');
const n = Number(input[0]);
const a = input[1].split(' ').map(Number);
let ans = 1;
for (let i = 0; i < n; i++){
    ans = ans * a[i];
}

if (BigInt(Math.pow(10,18)) < BigInt(ans)) {return console.log(-1);}
console.log(BigInt(ans));