#include <stdio.h>
#include <math.h>

typedef unsigned long long int ULLI;

int main()
{
	ULLI sum = 1;
	ULLI limit;
	ULLI a;
	int n;
	int flag = 0;

	scanf("%d", &n);

	limit = pow(10, 18);

	for (int i = 0; i < n; i++) {
		scanf("%llu", &a);
		if (a == 0) {
			flag = 0;
			sum = 0;
		}
		else if(flag==0)
			sum *= a;

		if (sum > limit)
			flag = 1;
	}

	if (flag == 1)
		printf("%d\n", -1);
	else
		printf("%llu\n", sum);

	return 0;
}