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