#include <stdio.h>
#include <stdlib.h>

int main(){
	int n;
	long long *ip;
	long long mult=1;
	
	scanf("%d",&n);
	ip = (long long*)calloc(n, sizeof(long long));
	for(int i=0;i<n;i++){
		scanf("%lld",ip);
		if((*ip) == 0){
			mult = 0;
			break;
		}else if((mult > 1000000000) && ((*ip) > 1000000000)){
			mult = -1;
		}else if(mult/1000000000*(*ip) > 1000000000){
			mult = -1;
		}else if(mult == -1){
			mult = -1;
		}else{
			mult *= (*ip);
			if(mult > 1000000000000000000) mult = -1;
		}
		
		ip++;
	}
	
	printf("%lld",mult);
	return 0;
}