process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = []
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

reader.on('line', (line) => {
  lines.push(line);
});

reader.on('close', () => {
 var n = Number(lines[0]);
 var a = lines[1].split(' ');
 var sum = 1;
 if(a.indexOf('0') != -1){
   sum = 0;
 }else{
   for(i=0; i<n; i++){
     sum = BigInt(sum) * BigInt(a[i]);
     if(sum > 1000000000000000000){
       sum = -1;
       break;
     }
   }
 }
 

 console.log(Number(sum));

 // console.log(a * b);
 
});