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

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) {
        if (arr[i]==1)
            continue;
        else if ( (digits(product)+digits(arr[i])) >= 19) {
            if (product == power(10,18))
                break;
            printf("-1");
            return 0;
        }
        else
        product *= arr[i];    
    }
    
    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;
}

int digits (long long f) {
    int count = 1;
    for ( int i=1 ; i<19 ; ++i) {
        if ( f/(power(10,i)) > 0) 
            count++;
    }
    return count;
}