#include <stdio.h>
#include <stdlib.h>

int main() {
    long long A[100000],answer = 1,max = 1000000000000000000;
    int n,i;
    scanf("%d",&n);
    
    for (i = 0;i < n;i++){
        scanf("%lld",&A[i]);
    }
    
    for (i = 0;i < n;i++){
        if (A[i] == 0){
            printf("0");
            return 0;
        }
    }
        
    for (i = 0;i < n;i++){
        if(max / A[i] < answer){
            printf("-1\n");
            return 0;
        }
        answer *= A[i];
    }
    
    printf("%lld\n",answer);
    
    return 0;
}
