function Main(input) {
  var N = parseInt(input.split("\n")[0]);
  var A = input.split("\n")[1].split(" ").map(n => BigInt(n));
  var result = A.reduce((a, b) => { return a * b });
  if (result > 10 ** 18) {
    console.log(-1);
  } else {
    console.log(result);
  }
}

  Main(require("fs").readFileSync("/dev/stdin", "utf8"));