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