function main(input) {
  const num = Number(input.split("\n")[0]);
  let ans = 1n;
  const numbers = input.split("\n")[1].split(" ").forEach(i => {
    ans *= BigInt(i);
    if (ans > 10**18) {
      return;
    }
  });
  
  if (ans > 10**18) {
    console.log(-1);
  } else {
  	console.log(Number(ans));
  }
}
 
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
