#include <stdio.h>
int main()
{
	int N;
	scanf ("%d",&N);
	long long int temp [N];
	long long int risolt=1;
	long long int limit=100000000000000000000;
	for (int i=0;i<N;i++)
	{
		scanf ("%lld",&temp[i]);
		if (temp[i]==0)
		{
			risolt=0;
			break;
		}
		else if (temp[i]>limit)
		{
			risolt = -1;
			break;
		}
		limit=limit/temp[i];
		risolt=risolt*temp[i];
	}
	printf ("%lld\n",risolt);
}