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