#include <stdio.h>
#include <math.h>

int main() {

    int n;
    scanf("%d", &n);
    long long a;
    long long mysum = 1;

    long long arr[n];
    for (int i = 0; i < n; i++) {
        scanf("%lld", &a);
        arr[i] = a;
    }

    for (int j = 0; j < n - 1; j++) {
        for (int k = j + 1; k < n; k++) {
            //printf("%d %d\n", arr[j], arr[k]);
            if (arr[j] > arr[k]) {
                long long temp = arr[j];
                arr[j] = arr[k];
                arr[k] = temp;
            }
        }
    }

    for (int j = 0; j < n; j++) {
        //printf("%lld \n", arr[j]);
        if (arr[j] == 0) {
            printf("0");
            return 0;
        } else {
            mysum *= arr[j];
        }
        if (mysum > 1000000000000000000) {
            printf("-1");
            return 0;
        }

    }
    printf("%lld", mysum);

    return 0;
}
