function main(input) {
  const n = parseInt(input[0]);
  const a = input[1].trim().split(" ").map(i => BigInt(i));
  let ans = 1n;
  for(i of a){
    ans = ans * i;
  }
  console.log((ans>10**18)?(-1):(ans+""));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"));