#include <stdio.h>
#include <string.h>

#define max 1000000000000000000

int main(){
	
	
	unsigned long long  N,A,sum=0,i;
	int ans=0;
	scanf("%llu",&N);
	
	for(i=0;i<N;i++){
		scanf("%llu",&A);
		if(ans!=-1){
			if(i==0)sum=A;
			else sum*=A;
			if(sum>max){
				//printf("-1\n");
				ans=-1;
			}
		}
		if(A==0){
			printf("0\n");
			return 0;
		}
	}
	if(ans==-1)printf("-1\n");
	else printf("%llu\n",sum);

	return 0;
}
