#include <stdio.h>
int main () {
	long long int a, b, c = 1;
	scanf ("%lld", &a);
	long long int batas = 1000000000000000000;
	for (long long int i = 0; i < a; i++) {
		scanf ("%lld", &b);
		if (b == 0) {
			c = 0;
			break;
		}
		if (b <= batas/c) {
			c *= b;
			batas /= b;
		} else {
			c = -1;
			break;
		}
	}
	
	printf ("%lld\n", c);
}