#include  <stdio.h>

int main(void)
{
   long long int a,b=1,c=1,d,x=1000000000000000000;
    scanf("%lld",&a);
    
    while(b<=a)
    {
        scanf("%lld",&d);
        c=c*d;
        if(d==0)
        {
            c=0;
            break;
        }
        if(d>x)
        { 
           c=-1;
        }

        
        x=x/c;
        
       
        b++;
    }
    
   
    
    printf("%lld",c);
    return 0;
}