#include<stdio.h>
int main()
{
	int n,i,x=0,y=0;
	long long a[100000],b=1;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%lld",&a[i]);
		if(a[i]==0) x=1;
	}
	if(x==1) printf("0\n");
	else{
		for(i=0;i<n;i++){
			if(a[i]<=1000000000000000000/b) b*=a[i];
			else{
				printf("-1\n");
				return 0;
			}
		}
		printf("%lld\n",b);
	}
	return 0;
}