#include  <stdio.h>

int main(void)
{
   long long int a,b=1,c=1,d;
    scanf("%lld",&a);
    
    while(b<=a)
    {
        scanf("%lld",&d);
         if(d==0)
         {
            printf("0");
            return 0;
         }
         c=c*d;
       
        if(c>1000000000000000000||c<0)
        { 
           c=-1;
        }
        
        b++;
    }
    
   
    
    printf("%lld\n",c);
    return 0;
}