#include <stdio.h>
 
long long power (int b, int p); 

int main() {
    int n;
    scanf("%d",&n);
    long long arr[n],product=1;
    
    for ( int i=0 ; i<n ; ++i ) {
        scanf("%lld",&arr[i]);
        if ( arr[i] == 0 ) {
            printf("0");
            return 0;
        }
    }    
    
    for (int i=0 ; i<n ; ++i) {
        product *= arr[i];
        if ( product > power(10,18) )
            break;
    }
    
    if ( product <= power(10,18)) {
        printf("%lld",product);
    }
    else
        printf("-1");
}

long long power (int b, int p) {
    long long power=1;
    for ( int i=0 ; i<p ; ++i) {
        power *= b;
    }
    return power;
}