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