#include <stdio.h>

int main(){
    long long  x = 1;
    int n;
    scanf("%d",&n);

    long long vet[n];

    for(int i = 0; i < n;++i){
        scanf("%lld",&vet[i]);
        if(vet[i] == 0){
            printf("0\n");
            return 0 ;
        }
    }
    for (int i = 0 ; i < n; ++i){
        
        if(x> 1000000000000000000ll/vet[i]){
        printf("-1\n");
        return 0;
        }
        else
        {
            x = vet[i] * x;
        }
        
    }
        

    
    printf("%lld\n",x);
    return 0 ;

}