#include <stdio.h>
#include <string.h>
#include <math.h>
#define N 1000000000000000000

int main() {

    int n;
    long long a;
    scanf("%d", &n);
    long long arr[n];

    long long mysum = 1;
    for (int i = 0; i < n; i++) {

        scanf("%lld", &a);
        if (a == 0) {
            printf("0");
            return 0;
        }
        arr[i] = a;
    }

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

    printf("%lld", mysum);

    return 0;
}
