const main = (input) => {
  const args = input.trim().split("\n");
  const nums = args[1].split(" ").map((n) => BigInt(n));
  const limit = 10n ** 18n;
  const isZero = nums.filter((n) => n === 0n).length > 0;
  if (isZero) {
    console.log(0);
    return;
  }
  const multipliedValue = nums.reduce((accum, current) => {
    if (accum > limit) {
      return 0n;
    }
    return accum * current;
  });

  if (multipliedValue === 0n || multipliedValue > limit) {
    console.log(-1);
  } else {
    console.log(multipliedValue.toString());
  }
};

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