#include <stdio.h>
#include<stdlib.h>

int main(void)
{
	int N,i,d=0;
	long long total=1,a;
	scanf("%d",&N);
	for(i=0;i<N;i++){
		scanf("%lld",&a);
		if(a==0){total=0;d=0;}
		if(d==0){
			if(1000000000000000000/llabs(total)>=llabs(a)){
				total*=a;
			}else {d++;}
		}
	}
	if(d!=0)printf("-1");
	else printf("%lld",total);
	return 0;
}