#include <stdio.h>

int main(void)
{
	
	int i;
	int n;
	//unsigned long a[10010];
	unsigned long a;
	unsigned long value = 1;
	unsigned long newValue = 0;
	unsigned long maxValue = 1000000000000000000;
	int over = 0;
	int fvalue=-1;
	
	scanf("%d",&n);
	
	for(i=0; i<n; i++){
		//scanf("%19lu",&a[i]);
		//printf("%19lu\n",a[i]);
		//value = value * a[i];
		scanf("%lu",&a);
		//printf("%lu\n",a);
		value = value * a;
		//printf("value = %lu\n",value);
	}
	
	
	if(value > 1000000000000000000){
			over = 1;
	}

	if(over == 0){
		printf("%lu\n",value);		
		//printf("%19lu\n",maxValue);
	}
	else{
		printf("%d\n",fvalue);
		//printf("%19lu",value);
		
	}
		
	
	return 0;
}