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(a[i] > 1000000000000000000/c) {
      console.log('-1');
      return;
    }
    c *= a[i];
  }
  
  console.log(c);
}
 
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim());
