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

int aadf(long long int d) {
	int i = 0;
	while (d > 9) {
		d = d / 10;
		i++;
	}
	return i;
}

int compare_int(const void* a, const void* b){
	return *(long long int*)a - *(long long int*)b;
}


int main() {
	long long int ans = 1;
	long long int a, c[100000] = {1};
	scanf("%lld", &a);
	for (int i = 0; i < a; i++)scanf("%lld", &c[i]);
	qsort(c, a, sizeof(long long int), compare_int);
	if (c[0] == 0) {
		printf("0");
		return 0;
	}
	for (int i = 0; i < a; i++) {
		ans *= c[i];
		if (ans > 1000000000000000000) {
			printf("-1");
			return 0;
		}
	}

	printf("%lld", ans);
	return 0;
}
