#include <stdio.h>
int main(void){
    // Your code here!
    long long ans = 1,tmp;
    int N;
    
    scanf("%d",&N);
    
    for(int i= 0; i < N; i++){
        scanf("%lld",&tmp);
        if(tmp == 0){
            printf("0\n");
            return 0;
        }
        
        if(tmp <= 1000000000000000000 / ans){
            ans *= tmp;
        }
        else{
            printf("-1\n");
            return 0;
        }
    }
    
    printf("%lld\n",ans);
    return 0;
}
