#include<stdio.h>
#include<string.h>
#include<math.h>


int main(void){
  long N,A[10000],cou=0,i,k,math=1,judge;
  scanf("%ld",&N);
  for(i=0;i<N;i++){
    scanf("%ld",&A[i]);
    math=math*A[i];
  }
	judge=pow(10,18);
  if((math<judge)||(math==judge)){
    printf("%ld",math);
    
  }else{
    printf("-1");
  }
  
  
   return 0;
}
