"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 = BigInt(String(Math.pow(10, 18)));

  let ans = line_two_array.reduce(function (previousValue, currentValue) {
    return BigInt(previousValue) * BigInt(currentValue);
  });
  if (ans > limit) {
    ans = -1;
  }
  console.log(parseInt(ans));
}

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