#include <stdio.h>

int main(void) {
    int n, i, an;
    unsigned long a = 1;
    scanf ("%d", &n);
    for (i = 0 ; i < n ; i++) {
        scanf ("%d", &an);
        a *= an;
        if (an == 0 || a > 1000000000000000000) {
            printf ("-1");
            return 0;
        }
        a *= an;
    }
    printf ("%lu", a);
}