#include <stdio.h>
#include <string.h>
#include <math.h>
 
int main(void){
  	char str[200000];
	char *data;
  	int input/*, mole*/;
  	long long int sum = 1, num[100];
  	//mole = pow(10, 9);
  
	fgets(str, sizeof(str), stdin);
  	sscanf(str, "%d", &input);
	fgets(str, sizeof(str), stdin);
	data = strtok(str, " ");
  	sscanf(data, "%lld", &num[0]);
  	sum = sum * num[0];
   	//oversum = oversum * num[0];
  	for(int i = 1; i < input; i++){
		data = strtok(NULL, " ");
  		sscanf(data, "%lld", &num[i]);
       	/*sum = sum * num[i];
      	oversum = oversum * num[i];
      	if(sum  > pow(10, 9)){*/
        //oversum += sum * num[i] / mole;
        sum = sum * num[i];
        //}
    }
  	
  	if(sum > 1000000000000000000 ){
			sum = -1;
    }
  	/*if( sum != -1 && oversum != 0 ){
		printf("%.0lld\n", sum);
    } else {*/
      	printf("%lld\n", sum);
    //}
  	
  	return 0;
}