#include  <stdio.h>

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