const [_, input] = require("fs").readFileSync("/dev/stdin", "utf8").split("\n");

if (/0/.test(input)) {
  console.log(0);
  process.exit(0);
}

const MAX = 10 ** 18;
const inputs = input
  .split(" ")
  .map((s) => parseInt(s, 10))
  .sort()
  .reverse();

let curr = 1;
inputs.forEach((n) => {
  curr = curr * n;
  if (curr > MAX) {
    console.log("-1");
    process.exit(0);
  }
});
console.log(curr);
