#include<stdio.h>

int main() {
	int  n;
	scanf("%d\n", &n);
	unsigned long long ans = 1, a[n];
	for (int i = 0; i < n; i++) {
		scanf("%llu", &a[i]);
		if (a[i] == 0) {
			printf("0\n");
			return 0;
		}
		if (a[i] > 1e18 / ans) {
			printf("-1\n");
			return 0;
		}
		ans *= a[i];
	}
	printf("%llu\n", ans);

	return 0;
}