#include<stdio.h>
int main(){

 int t,i;
 long long int a=1,b=1;
 scanf("%d",&t);
 if(t>=2 && t<=100000){
         while(t--){


        scanf("%lld",&b);
        if(b>=0 && b<=1000000000000000000){
                a*=b;
            if(a>1000000000000000000){
              a=-1;

          }


        }

}
}
printf("%lld",a);

return 0;
}