// inputに入力データ全体が入る
function Main(input) {
  input = input.trim().split('\n');
  var N = input[0];
  var As = input[1].split(' ').map(x=>BigInt(x));
  var prod = 1n
  for (i=0;i<N;i++){
    prod *= As[i];
    if (prod > 10n ** 18n){
      prod = -1n;
      break;
    }
  }
  console.log(prod.toString());
}



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