#include<stdio.h>
#include<stdlib.h>
#define ma 1000000000000000000
int main()
{
  	int N,i=1;
  	long long A;
  	long long prod=1;
  	scanf("%d",&N);
  	while(prod<=ma && i<N)
	{
		scanf("%lld",&A);
        if(A==0)
          break;
		prod = prod * A;
	}	
	if (prod<=ma)
		printf("%lld",prod);
	else
		printf("-1");
}