#include <stdio.h>
int main () {
	long long int a, b, c = 1;
	scanf ("%lld", &a);

	long long int batas = 1000000000000000000;
	int flag = 0;
	for (long long int i = 0; i < a; i++) {
		scanf ("%lld", &b);
		if (c * b <= batas && flag == 0) {
			c *= b;
		} else {
			flag = 1;
		}
	}
	
	if (flag == 1) {
		c = -1;
	}
	if (a == 0) {
		c = 0;
	}
	
	printf ("%lld\n", c);
}