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