#include<stdio.h>

int main(){
  
  int i;
  int n;
  long long a[100000];
  long long ans = 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++){
      
    printf("a = %lld ans = %lld\n",a[i] ,ans);
    if(a[i] <= 1000000000000000000/ans){
      ans *= a[i];
    }else{
      printf("-1\n");
      return 0;
    }
    
  }
    
  printf("%lld\n",ans);
    
  return 0;
        
}