#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
 
#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) < (b) ? (a) : (b))

int main(void) {
	long long N, A, result = 1;
	long long flag = 0, flag_zero = 0;
	
	scanf("%lld", &N);
	for (long long i = 0; i < N; i++) {
		scanf("%lld", &A);
		result *= A;
		if (result > 1000000000000000000) {flag = 1;}
		if (A == 0) flag_zero = 1;
	}
	
	if (result <= 1000000000000000000) flag = 0;
	
	printf("%lld\n", flag_zero ? 0 : flag ? -1 : result);
	
	return 0;
}