#include <stdio.h>
#define LIMIT_NUM 1000000000000000000ULL

int main(void) {
    int N;
    unsigned long long result = 1;

    scanf("%d", &N);
    unsigned long long A[N];

    for (int i = 0; i < N; i++) {
        scanf("%llu", &A[i]);
    }

    // 0が存在する場合
    for (int i = 0; i < N; i++) {
        if (A[i] == 0) {
            printf("0\n");
            return 0;
        }
    }

    for (int i = 0; i < N; i++) {
        // A*result>10^18 -> A>10^18/result
        if (A[i] > LIMIT_NUM / result) {
            printf("-1\n");
            return 0;
        }
        result *= A[i];
    }

    printf("%lld\n", result);
    return 0;
}
