#include <stdio.h>

int main(void) {
	int N;
	unsigned long long A;
	unsigned long long mu;
	
	scanf("%d", &N);
	scanf("%lld", &mu);
	
	for(int i = 1; i < N; i++) {
		scanf("%lld", &A);
		
		if(A == 0) {
			mu = 0;
			break;
		}
		if(mu > 1000000000000000000) {
			mu = -1;
		}
		else {
			mu *= A;
		}
	}
	
	if(mu > 1000000000000000000) {
		mu = -1;
	}
	
	printf("%lld\n", mu);
	
	return 0;
}
