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

#define MAX 1000000000000000000

int main(void) {
	int n, i, *a;
	long m=1;
	scanf("%d", &n);
	a = malloc(n * sizeof(int));
	for (i = 0; i < n; i++) {
		scanf("%d", a+i);
		if (a[i] == 0) {
			printf("0\n");
			return 0;
		}
	}
	for (i = 0; i < n; i++) {
		if (MAX / a[i] < m) {
			printf("-1\n");
			return 0;
		}
		m *= a[i];
	}
	printf("%ld\n", m);
	return 0;
}
