function main(input) {
  const num = Number(input.split("\n")[0]);
  const numbers = input.split("\n")[1].split(" ");
  let ans = 1;
  numbers.forEach(i => ans *= Number(i));
  
  if (`${ans}`.length >= 18) {
    console.log(-1);
  } else {
  	console.log(ans);
  }
}
 
main(require('fs').readFileSync('/dev/stdin', 'utf8'));