function Main(input) {
  var N = parseInt(input.split("\n")[0]);
  var A = input.split("\n")[1].split(" ").map(n => parseInt(n));
  var result = 1n;
  for (i = 0; i < N; i++) {
    if (result > 10 ** 18) {
      console.log(-1);
      break;
    }
    result = result * BigInt(A[i]);
  }
  if (result <= 10 ** 18) {
    console.log(result.toString());
  }
}

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