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

int main(void)
{
	int n, i,c=-1;
	long long int a, b, result = 1;

	//input
	scanf("%d", &n);
	b = pow(10, 18);

	for (i = 0;i < n;i++) {
		scanf("%lld", &a);
		
		if (a == 0) {
			result *= a;
			printf("%lld",result);
			return 0;
		}

		if (result > b/a)
		{
			printf("%d", c);
			return 0;
		}
		
		result *= a;
	}


	
	//output
	printf("%lld", result);
	return 0;
}