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

int main(void)
{
	int i,n;
	long double threshold,mult=1,temp;

	scanf("%d",&n);

	threshold = pow(10,18);
	threshold += 1.0;

	for(i=0;i<n;i++){
		scanf("%Lf",&temp);
		if((mult*=temp)>=threshold){
			mult = -1;
			break;
		}
	}

	printf("%.0Lf\n",mult);

	return 0;
}

