#include <stdio.h>

int main()
{
	int n;
	scanf("%d", &n);

	register long long unsigned int a= 1;
	long long unsigned int b;
	int i;
	for (i = 0; i < n; i++) {
		scanf("%llu", &b);
		a *= b;
		if (a > 1E18) {
			printf("-1\n");
			return 0;
		}
	}
	printf("%llu", a);
	return 0;
}