#include<stdio.h>
int main (void){
    int N,i;
    long long int result;
    long long int A[100000];
    result = 1;
    if(scanf("%d",&N) <2) return 0;
    for(i=0;i<N;i++){
       if(scanf("%lld",&A[i]) > 1000000000000000000) return 0;
        result = result * A[i];
    }
    if(result>=1000000000000000000 || result < 0){
        printf("-1");
    }else{
        printf("%lld\n",result);
    }
    return 0;
}