#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <stdio.h>
int compare(const void *a,const void *b){
    if(*(long long *)a>*(long long *)b)return 1;
    return -1;
}
int main(int argc, const char * argv[]) {
    int n;
    scanf("%d",&n);
    long long a[n];
    double ap[n];
    for(int i=0;i<n;i++){
        scanf("%lld",&a[i]);
        ap[i]=(double)a[i];
    }
    qsort(a,n,sizeof(long long),compare);
    if(a[0]==0){
        printf("0");
        return 0;
    }
    double t=ap[n-1];
    for(int i=n-2;i>=0;i--){
        t*=ap[i];
        if(t>1000000000000000000){
            printf("-1");
            return 0;
        }
    }
    unsigned long long ans=1;
    for(int i=0;i<n;i++){
        ans*=a[i];
    }
    if(ans>1000000000000000000){
        printf("-1");
    }else{
        printf("%lld",ans);
    }return 0;
}
