process.stdin.resume();
process.stdin.setEncoding('utf8');

let inputData = '';

process.stdin.on('data', inputStdin => {
  inputData += inputStdin;
});

process.stdin.on('end', _ => {
  inputData = inputData.replace(/\s*$/g, '')
    .split('\n')
    .map(str => str.split(' '));
  main();
});

function solve(n, a) {
  const limit = 10n ** 18n;
  let result = 1n;
  
  for (let i = 0; i < n; i++) {
    if (a[i] === 0) {
      return 0;
    }

    result *= BigInt(a[i]);

    if (result > limit) {
      return -1;
    }
  }
  return result;
}

function main() {
  const n = inputData[0][0];
  const a = inputData[1];

  process.stdout.write(solve(n, a).toString());
}
