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

int main(){

    long long int n, i,ans=1;
    double dans=1;
    scanf("%lld",&n);
    long long int *arr = (long long int*)malloc(n*sizeof(long long int));
    for(i=0;i<n;i++){
        scanf("%lld",arr+i);
        if(arr[i] == 0){
            printf("%d\n",0);
            return 0;
        }
    }
    for(i=0;i<n;i++){
        
        ans *= arr[i];
        dans *= (double)arr[i];
        if(dans>1000000000000000000||ans>1000000000000000000){
            printf("%d\n",-1);
            return 0;
        }
    }
    printf("%lld\n",ans);
    return 0;
}
