#include<stdio.h>
int main(void){
    int n;
    scanf("%d",&n);

    int i;
    long long int a[n];
    long long int ans=1;
    int flag=1;
    int flagb=0;
    for(i=0;i<n;++i){
        scanf("%lld",&a[i]);
    }

    for(i=0;i<n;++i){
        ans=ans*a[i];
        if(a[i]>=1000000000000000000){
            flag=0;
        }
        if(a[i]==0){
            flagb=1;
        }
    }
    
    if(flagb==1){
        flag==1;
    }
    if(flag==1&&ans<=1000000000000000000){
        printf("%lld\n",ans);
    }else{
        printf("-1\n");
    }
    return 0;
}