#include<stdio.h>

int main()
{
	int n;
	scanf("%d", &n);
	int zero = 0;
	long long a[n];
	
		int over = 0;
	for (int i = 0; i < n; i++)
	{
		scanf("%lld", &a[i]);
		if (a[i] == 0) zero = 1;
		if (a[i] > 1000000000000000000) over = 1;
	}
	if (zero) printf("0\n");
	else 
	{
		long long result = 1;
		for(int i = 0; i < n; i++)
		{
			if(a[i] > 1000000000000000000 / result)
			{
				printf("-1\n");
				return 0;
			}
			result *= a[i];
		}
		if (over) printf("-1\n");
		else printf("%lld\n", result);
	}
	return 0;
}