#include<stdio.h>
#include<math.h>

int main(){
	int N;
	int i;
	long long ans=1;
	scanf("%d",&N);
	long long A[N];
	for(i=0;i<N;i++){
		scanf("%lld",&A[i]);
		if(A[i]>(long long)pow(10,18)){
			ans=-1;
			break;
		}
		ans*=A[i];
	}
	if(ans>(long long)pow(10,18))printf("%d\n",-1);
	else printf("%lld\n",ans);
	return 0;
}

