function main(input) {
  input = input.split('\n');
  const n = parseInt(input[0]);
  const a = input[1]
    .trim()
    .split(' ')
    .map((i) => BigInt(i));
  let ans = 1n;
  if (!a.includes(0n)) {
    for (let i = 0; i < n; ++i) {
      if (ans > 10 ** 18) {
        break;
      }
      ans = ans * a[i];
    }
    console.log(ans > 10 ** 18 ? -1 : ans + '');
  } else {
    console.log(0);
  }
}

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