function main(input) {
    // 入力値の分離
    param = input.split("\n");
    const num = param[1].split(" ");
    var result = BigInt(num[0]);
    for(var i = 1; i < param[0]; i++){
      result = result * BigInt(num[i]);
      if(result == BigInt(0)){
		break;
	  }
    }
	if(result > Math.pow(10, 18)){
        result = -1;
      }
	console.log(parseInt(result));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));