#include<stdio.h>


int main(void){
    int N;
    long int sum = 1;

    scanf("%d", &N);

    int A[N];
    
    for(int i = 0; i < N;i++){
        scanf("%d", &A[i]);
        sum *= A[i];
    }
    
    if(sum > 1000000000000000000){
            printf("-1");
    }
    else{
        printf("%ld", sum);
    }

    return 0;
}