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