#include <stdio.h>
int main(){
    unsigned long long int n;
    scanf("%lld",&n);
    unsigned long long int a[n];
    unsigned long long int e=1;
    for(unsigned long long int i=0;i<n;i++){
        scanf("%lld",&a[i]);
        if(a[i]==0){
            e=0;
        }
    }
    if(e==0)goto end;
    for(unsigned long long int i=0;i<n;i++){
        e=e*a[i];
        if(e>1000000000000000000){
            printf("-1");
            return 0;
        }
    }
    end:
    if(e<=1000000000000000000)printf("%lld",e);
    else printf("-1");
    return 0;
}