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

function main(input) {
  input = input.split('\n');
  const n = +input[0];
  let arr = input[1].split(' ');
  let sum = 1n;
  const max = 10n ** 18n;
  for (let i = 0; i < n; ++i) {
    const x = BigInt(arr[i]);
    sum *= x;
    if (sum > max) {
      console.log(-1);
      return;
    }
  }
  console.log(sum);
}
