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


function main(input) {
  input = input.split('\n');
  const n = +input[0];
  const arr = input[1].split(' ').map(BigInt);

  let sum = 1n;
  const max = BigInt(1000000000000000000);
  for (let i = 0; i < arr.length; ++i) {
    if (arr[i] == 0n) {
      console.log(0);
      return;
    } else {
      sum *= arr[i];
      if (sum > max) {
        console.log(-1);
        return;
      }
    }
  }
  console.log(sum.toString());
}
