#include<stdio.h>
signed main(){
    long long n,i;
    long long sum=1;
    long long a[100000];
    scanf("%lld",&n);
    for(i=0;i<n;i++){
        scanf("%lld",&a[i]);
        if(a[i]==0){
            printf("0\n");
            return(0);
        }else{
        if(a[i]<=1000000000000000000/sum){
            sum=sum*a[i];
            
        }else{
            printf("-1\n");
        }
        }
      
    }
    if(sum<=1000000000000000000){
        printf("%lld\n",sum);
    }
    return(0);   
}