#include<stdio.h>

int main(void){
    unsigned long long int y = 1,a[100001];
    int n;
    int x;
    scanf("%d",&n);
    for(x = 0;x < n;x++){
        scanf("%lld",&a[x]);
        y *= a[x];
    }
    if(y > 1000000000000000000){
        printf("-1\n");
    }else{
        printf("%lld\n",y);
    }
    return 0;
}
