#include <stdio.h>

int main(void) {
    long long int n = 1000000000000000000, N;
    long long int sum = 1;
    scanf("%lld", &N);
    long long int a[N];
    for(int i = 1; i <= N; i++) {
        scanf("%lld", &a[i]);
        if(a[i] == 0) {
            sum = 0;
        }
    }

    for(int i = 1; i <= N; i++) {
        if(a[i] == 0) {
            sum = 0;
            break;
        }
        else if(c/a[i] < sum) {
            printf("-1\n");
            break;
        }
        else {
            sum *= a[i];
        }
    }
    printf("%lld\n", sum);
    return 0;
}