"use strict";

function main(input) {
  input = input.trim().split("\n");
  const line_one = parseInt(input[0]);
  const line_two_array = input[1].split(" ");
  const limit = Math.pow(10, 18);

  let ans = 1;
  for (let i = 0; i < line_one; i++) {
    ans = ans * parseInt(line_two_array[i]);
    if (ans > limit) {
      ans = -1;
      break;
    }
  }
  console.log(ans + 1);
}

main(require("fs").readFileSync("/dev/stdin", "utf-8"));
