#include <stdio.h>
int main(void){
   int N, A[114514], i;
   long long int S=1;

   scanf("%d",&N);

   for(i=0;i<N;i=i+1){
   scanf("%d",&A[i]);
   S=A[i]*S;
   }; 

   if(S>100000000000000000)
     printf("%lld",S);
   else
     printf("-1");     
   
   return 0;
}