#include <stdio.h>

int main (){
	long long int N;
	scanf("%lld", &N);
	long long int X, sum=1;
	for (int p=0 ; p<N; p++){
		scanf("%lld", &X);
		sum=sum*X;
	}
	sum >= 1000000000000000000?printf("-1"):printf("%d", sum);
		
	
	return 0;
}
