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