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