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

int main() {
	long long int n, a[100001], ans = 1, i = 0, f = 0;
	scanf("%lld", &n);
	for (i = 0; i < n; i++) {
		scanf("%lld", &a[i]);
	}
	for (i = 0; i < n; i++) {
		if (a[i] == 0) {
			ans = 0;
		}
	}
	i = 0;
	while (i < n && f == 0) {
		ans = ans*a[i];
		i++;
		if (ans > 1000000000000000000) {
			ans = -1;
			f++;
		}
	}
	printf("%lld", ans);
}