#include <stdio.h>
 
long long power (long long 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]);
        product *= arr[i];
    }
    if ( product <= power(10,18)) {
        printf("%lld",product);
    }
    else
        printf("-1");
}

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