#include <stdio.h>

int main(){
    int n,i;
     long long int a[100000],c=1;
    scanf("%d", &n);
  
   for(i=0; i<n; i++){
  scanf("%lld",&a[i]);
   
  

        if (a[i] == 0){
            printf("0");
            return 0;
        }
    }


for (i = 0;i < n;i++){
if(a[i]<=1000000000000000000/c){
  c*=a[i];}
  else printf("-1\n");
            return 0;
    }
    
    printf("%lld\n",c);
    
    return 0;
}
