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 = BigInt(parseInt(A[0],10));
for(i = 1; i < N; i++) {
  B = B * BigInt(parseInt(A[i],10));
  if(B > Math.pow(10,18)) { B = -1; break; }
}
console.log((B + '').replace('n',''));