#include <stdio.h>

int main (void) {
    int n;
    long long a[100010];
    long long result = 1;
    scanf("%d", &n);
    for (int i=0; i<n; i++) {
        long long input;
        scanf("%lld", &input);
        a[i] = input;
        if (input == 0) {
            result = 0;
        }
    }

    if (result == 0) {
        printf("%d\n", 0);
        return 0;
    }

    for (int i=0; i<n; i++) {
        if (a[i] <= 1000000000000000000/result) {
            result *= a[i];
        } else {
            printf("-1\n");
            return 0;
        }
    }

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