import * as fs from 'fs';

const args = fs.readFileSync('/dev/stdin', 'utf8').trim().split('\n');
const a  = args[1].split(' ').map(x=>BigInt(x));
let ans  = a.reduce((acc, cur) => {BigInt(parseInt(acc * cur))}, 1);
console.log((ans > Math.pow(10,18)) ? -1 : ans);
