#include <stdio.h>
#include <stdlib.h>
int main(void) {
	int n;
	long long  a;
	long long sum = 1,max=1000000000000000000;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%lld",&a);
		if(a == 0){
			sum = 0;
			break;
		}else if(max / a< sum){
			sum = -1;
			break;
		}
		else{
		sum = sum * a;
		}
	}
	printf("%lld",sum);
	return 0;
}
