#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]<=1000000000000000000/sum){
            sum=sum*a[i];
        }else{
            printf("-1\n");
            return(0); 
        }
    }
    printf("%lld\n",sum);
    return(0);   
}