function Main(input) {
  const [_a, _b] = input.split("\n");
  const _c=_b.split(" ");
  let _d=BigInt(1);
  for(let i=0; i<_a; i++){
    _d=_d*BigInt(_c[i]);
    if(_d > 1000000000000000000){
      _d=-1;
      break;
    }
  }
  console.log(_d);
}

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