#include <stdio.h>

int main(){
    long long  x = 1;
    int n;
    scanf("%d",&n);

    int vet[n];

    for(int i = 0; i < n;++i){
        scanf("%lld",&vet[i]);
        if(vet[i] == 0){
            printf("0\n");
            return 0 ;
        }
        x = vet[i] * x;
    }
    if(x < 1000000000000000000)
        printf("%lld",x);
    else    
        printf("-1\n");
    return 0 ;

}