fs = require('fs').readFileSync('/dev/stdin','utf-8');
tmp = fs.split('\n');
N =tmp[0];
A = tmp[1].split(' ');
for(i = 0; i < N; i++) {
  if(A[i] == '0') { console.log('0'); return; }
}
B = parseInt(A[1],10);
for(i = 1; i < N; i++) {
  B *= parseInt(A[i],10);
  if(B > Math.pow(10,18)) { B = -1; break; }
}
console.log(B);
