#include <stdio.h>
#include <string.h>

int main() {

    int n;
    scanf("%d", &n);

    long mysum = 1;
    for (int i = 0; i < n; i++) {
        long a;
        scanf("%ld", &a);
        mysum *= a;
    }

    if (mysum > 1000000000000000000) {                
        printf("-1");
    } else {
        printf("%ld", mysum);
    }

    return 0;
} 