#include <stdio.h>

int nanzyo(long long);

int nanzyo(long long N){
  int ans = 0;
  while(N/10 > 0){
    N /= 10;
    ans+=1;
  }
  return ans;
}

int main(void){
  long i, N;
  long long A, ans=1;
  int a,b,flag=0;
  
  scanf("%ld",&N);
  
  for(i=0;i<N;i++){
    scanf("%lld",&A);
    a = nanzyo(ans);
    b = nanzyo(A);
    if(A==0){
      flag = 2;
      break;
    }
    if(a+b>18){
      flag=1;
    }else{
      ans *= A;
      if(ans > 1000000000000000000){
        flag=1;
      }
    }
  }
  
  if(flag==2){
    printf("%d\n",0);
  }else if(flag==1){
    printf("%d\n",-1);
  }else{
    printf("%lld",ans);
  }
    
  
  return 0;
}
