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