#include <stdio.h>
#include <stdlib.h>
int main(void){
    long int A[100001];
    long int N,i,ans=1;
    
    scanf("%ld",&N);
    
    for(i=0;i<N;i++){
        scanf("%ld",&A[i]);
        
    }
    
    for(i=0;i<N;i++){
        ans=ans*A[i];
        
        if(A[i]==0){
            ans=0;
            printf("%ld\n",ans);
            exit(1);
        }
        
        if(ans>1000000000000000000){
            ans=-1;
            printf("%ld\n",ans);
            exit(1);
        }
    }
    
    printf("%ld\n",ans);
    
    return 0;
}