#include<stdio.h>

#define ma 1000000000000000000
int main()
{
  	int N,i=0;
  	long long A[1000000];
  	long long prod=1;
  	scanf("%d",&N);
	while(i<=N){
		scanf("%lld",&A[i]);
		i++;
	}
	i = 0;
  	while(prod<=ma && i<N)
	{
		if(A[i]==0){
			prod =0;
			break;
		}
		prod = prod * A[i];
		
	}	
	if (prod<=ma)
		printf("%lld",prod);
	else
		printf("-1");
}