#include <stdio.h>
#include <math.h>
#define LIMIT 1000000
int main(void){
  int N,i,judge=0;
  long long int A[LIMIT] = {0},mult = 1;
  scanf("%d",&N);
  for(i=0; i<N; i++){
    scanf("%lld",&A[i]);
    if(A[i]==0){
      printf("0\n");
      return 0;
    }
  }

  
  for(i=0; i<N; i++){
    if(A[i]<=1000000000000000000/mult){
      mult *= A[i];
    }else{
      printf("-1\n");
      judge = 1;
      break;
    }
  }
  
  if(judge == 0){
    printf("%lld\n",mult);
  }
  return 0;
}
  
  



    
