function main(input) {
  const a = input.split('\n')[1].split(' ').map(Number);

  if(a.some(x => x===0)){
    console.log('0');
    return;
  }

  let c = 1;
  for(let i=0; i< a.length; i++){
    if((BigInt(a[i]) * BigInt(c)) > 1000000000000000000) {
      console.log('-1');
      return;
    }
    c = BigInt(a[i]) * BigInt(c);
  }

  console.log(c);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8').trim());
