function main(input) {
    const args = input.split('\n');
  	var targets = args[1].split(' ');
  	var sum = 1;
    for (var i = 0; i < args[0]; i++) {
    	sum = sum * targets[i];
    }
  if (sum > 1000000000000000000) {
    console.log(-1)
  } else {
  	console.log(sum);
  }
}

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