#include <stdio.h>
#include <math.h>

int main(){
	long N,A[100000],result=1,flag=1;
	scanf("%ld",&N);
	for(int i=0;i<N;i++){
		scanf("%ld",&A[i]);
		if(A[i]==0){
		printf("0");
		return 0;
		}
		if(1>(long)1e18/result*A[i]){
			flag=0;
		}
		else result=result*A[i];
	}
	if(flag==0)puts("-1");
	else printf("%ld\n",result);
  	return 0;
}