function Main(input) {
  var n = parseInt(input.split("\n")[0], 10);
  var a = input.split("\n")[1].split(" ");
  
  var sum = 1;
  for (var i = 0; i < n; i++) sum *= a[i];
  
  var pow = Math.pow(10, 18);
  if (sum > pow) {
    console.log(-1);
  } else console.log(sum);
}

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