#include <stdio.h>

typedef unsigned long long int ULLI;

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

	scanf("%d", &n);

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

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

	return 0;
}