#include<stdio.h>
 
int main(void)
{
	long long a;
	int i,flag=-1;
	unsigned long long N,ans=1;
 
	scanf("%lld", &N);
 
	for (i = 0; i < N; i++)
	{
		scanf("%lld", &a);
 
	
		if (a == 0)
		{
			ans = 0;
			break;
		}
if(ans<1000000000000000000)
{
	ans =  ans*a;
}	
	}
	 if(ans>1000000000000000000)
		{
			ans = flag;
		}
	printf("%lld", ans);
	return 0;
}