#include <stdio.h>

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

	long long int a= 1;
	long long int b;
	int i;
	for (i = 0; i < n; i++) {
		scanf("%llu", &b);
		a *= b;
//		printf("%d %llu\n", i,a);
		if (a > (long long int)1e18) {
			a = -1;
		}
	}
	if (a < 0)
		printf("-1\n");
	else
		printf("%llu\n", a);

	return 0;
}