#include <stdio.h>

int main (void) {
    int n;
    int a[100000];
    unsigned long result = 1;
    scanf("%d", &n);
    for (int i=0; i<n; i++) {
        int input;
        scanf("%d", &input);
        a[i] = input;
        result *= input;
        if (result < 0) {
            printf("-1\n");
            return 0;
        }
    }
    printf("%ld\n", result);
    return 0;
}