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