#include<stdio.h>
#include<math.h>
int main()
{
	unsigned long long a, sum, n, i;
	unsigned long long answer = 1;
	scanf("%llu", &n);
	for (i = 0; i < n; i++)
	{
		a = 0;
		scanf("%llu", &a);
		answer = answer * a;
	}
	sum = pow(10, 18);
	if (sum >= answer) {
		printf("%llu", answer);
	}
	else
		printf("%d", -1);
	return 0;
}