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

int main() {

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

    for (int i = 0; i < n; i++) {
        scanf("%lld", &a);

        if (a == 0) {
            printf("0");
            return 0;
        }
        
        mysum *= a;
        if (mysum > 1000000000000000000) {
            printf("-1");
            return 0;
        }
        //printf("%lld\n", mysum);
    }

    if (mysum > 1000000000000000000) {
        printf("-1");

    } else {
        printf("%lld", mysum);
    }
    return 0;
}
