#include<stdio.h>
int main  (){
  long N;
  long ans = 1;
  scanf("%ld",&N);
  long A[N];
  for(int i=0;i<N;i++){
    if(ans>1000000000000000000){
        printf("-1");
        break;
      }
    scanf("%ld",& A[i]);
    ans = A[i]*ans;
      
  
  }
   if(ans<1000000000000000000){
     printf("%ld", ans); 
   }else{
     ans = -1;
    printf("%ld",ans);
   }
  return 0;
}