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