#include <stdio.h>
#include <stdlib.h>
int asc(const void *a,const void *b){
    return *(long long*)a-*(long long*)b;
}
int main(void){
    int n,i;
    scanf("%d",&n);
    long long a[n],sum=1;
    for(i=0;i<n;i++) scanf("%lld",&a[i]);
    qsort(a,n,sizeof(long long),asc);
    if(a[0]==0) printf("0");
    else{
        for(i=0;i<n;i++){
            sum *= a[i];
            if(sum>1000000000000000000){
                printf("-1");
                return 0;
            }
        }
        printf("%lld",sum);
    }
}