#include<stdio.h>
int main  (void){
  long N;
  long ans = 1;
  scanf("%ld",&N);
  long A[N];
  for(int i=0;i<N;i++){
    scanf("%ld",& A[i]);
    ans = A[i]*ans;
  }
   if(ans<1000000000000000000){
     printf("%ld", ans); 
     
    }else{
    printf("-1");
   }
}