"use strict";

const main = (arg) => {
  const array = arg.trim().split("\n");
  const N = parseFloat(array[0]);
  const aArray = array[1].trim().split(" ");
  let answer = 1;
  for (let i = 0; i < aArray.length; i++) {
    // console.log(aArray[i]);
    answer = answer * parseFloat(aArray[i]);
    if (10000000000000000000 < answer) {
      answer = -1;
      break;
    }
  }
  console.log(answer);
};
main(require("fs").readFileSync("/dev/stdin", "utf8"));
// main("31\n4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 9 5 0");
// https://atcoder.jp/contests/abc169/tasks/abc169_a
