#include <stdio.h>
#include <math.h>

int main(void){
    // Your code here!
    int N;
    
    scanf("%d", &N);
    
    unsigned long long int A[N];
    unsigned long long int M = 1;
    
    for(int i=0; i<N; i++){
        
        scanf("%d", &A[i]);
        
        M=M*A[i];
        
    }
    
    
    if(M > pow(10, 18)){printf("-1\n");}
    else{printf("%llu\n", M);}
}
