const i = require("fs").readFileSync("/dev/stdin", "UTF-8");
 
let ii = i.split('\n');
let n = +ii[0];
 
let r = 1;
 
for (let i < 0; i < n; i++) {
  r *= +ii[1].split(' ')[i];
}
 
console.log(r > 10 ** 18 ? -1 : r);