#include <stdio.h>

int main() {
    int n, a = 0, pass = 0;
    unsigned long long total = 1;
    scanf("%d", &n);
    int vec[n];
    
    for (int i = 0; i < n; ++i){
        scanf("%lld", &vec[i]);
        if (vec[i] == 0)
            a = 1;
    }
    if (a == 1)
        printf("0\n");
    else{
        for (int i = 0; i< n; ++i){
            total *= vec[i];
            if (total > 1000000000000000000){
                pass = 1;
                break;
        }
    }

        
    if (pass == 1)
        printf("-1\n");
    else
        printf("%llu\n", total);
    
    }
    
    
    return 0;
}
