#include<stdio.h>
long long int at = 1e18;
int main()
{
	int n;
	scanf("%d",&n);
	long long int m = 1,x;
	int al = 0;
	for(int i=0;i<n;i++)
	{ 
		scanf("%lld",&x);
		m = m*x;
		if(m>at)
		{
			al = 1;
		}
	}
	if(m>at || al == 1)
		printf("-1\n");
	else
		printf("%lld\n",m);
}