#include <stdio.h>

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