        #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;}
              }
        for(i=0;i<a;i++){
            long double cc=c;
            long double bi=b[i];
            if(cc*bi>1e+18){printf("-1");return 0;
                                }
                c=c*b[i];}
        printf("%llu\n",c);
         return 0;
        }