#include <stdio.h>

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