    #include <stdio.h>
     
    int main()
    {int a,i;
    scanf("%d",&a);
    unsigned long long b[100000],c;
    c=1;
    for(i=0;i<a;i++){
        scanf("%llu",&b[i]);
        if(b[i]==0){printf("0");return 0;}
        if(c*b[i]>1e+18){printf("-1");return 0;
                            }
            c=c*b[i];}
     return 0;
    }