#include<stdio.h>
int main(void){
	int N;
	long A[4]={1};
	int i;
	long s;
	long t=1;
	int flag;
	long out;
	scanf("%d",&N);
	
	
	for(i=0;i<N;i++){
		scanf("%ld",&A[i]);
	}
	
	for(i=0;i<N;i++){
		t *= A[i];
		if(A[i] == 0){
			out =0;
			break;
		}
		s = (long)1e18/t;
		if(s == 0){
			flag =1;
		}
	}
	if(flag ==1){
		out=-1;
	}
	else{
		out =t;
	}
	
	printf("%ld",out);
	
	return 0;
}