#include <stdio.h>
#include <math.h>
int main() {
    int n,t;long long h, i, j = 1, p = 0, l = 0, f = 0;

    scanf("%d",&n);
    for(t=1;t<=n;t++) {

        scanf("%lld", &h);
        j=j*h;
    }
    if(j>=pow(10,18)){
        printf("%lld\n",j);

    }
    else{
        printf("-1\n");
    }
    return 0;
}


