#include<stdio.h>

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