#include <stdio.h>
int main()
{
   
   long long int tc;
   long long int sum = 1;
   scanf("%lld", &tc);
   int flag = 0;
   long long int test[tc];
   
   for(long long int i = 0; i < tc; i++)
   {
   		if(sum > 1000000000000000000)
   		{
   			break;
			flag = 1;	
		}
   		scanf("%lld", &test[i]);
   		sum = sum * test[i];
   }
   
   long long int total = 1;
   if(flag == 1)
   {
   	  printf("-1\n");
   } else if(sum <= 1000000000000000000)
   {
   		printf("%lld", sum);
   } else
   {
   		printf("-1\n");
   }	
   

   return 0;
}