#include<stdio.h>
#include<stdlib.h>
const unsigned long long lim = 1000000000000000000ull;

static inline unsigned long long mul(unsigned long long lhs,unsigned long long rhs){
    if((long double)lim / lhs < (long double)rhs){
        puts("-1");
        exit(0);
    }
    return lhs * rhs;
}

int main(void){
    int n;
    register int i;
    scanf("%d",&n);
    unsigned long long a[n],tmp = 1;
    for(i = 0;i < n;i++)scanf("%llu",&a[i]);
    for(i = 0;i < n;i++)if(!a[i]){
        puts("0");
        return 0;
    }
    for(i= 0;i < n;i++){
        tmp = mul(tmp,a[i]);
    }
    printf("%llu",tmp);
}