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

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

if (inputs.includes("0")) {
  console.log(0);
  process.exit(0);
}

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