#include<stdio.h>

int main(void){
    long int N;
    scanf("%ld", &N);
    long int A[N];
    long int sum = 1;
    long int flag = 1000000000000000000;

    for(long int i = 0;i < N; i++){
        scanf("%ld", &A[i]);
        sum *= A[i];
    }

    if(sum > flag){
        printf("-1");
    }
    else{
        printf("%ld", sum);
    }

    return 0;
}