import * as fs from 'fs';

const args = fs.readFileSync('/dev/stdin', 'utf8').trim().split('\n');
const a  = args[1].split(' ').map(Number);

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