#include<stdio.h>

int main(void)
{
  long A[10000],C=1,N;
  scanf("%ld",&N);
  for(long i=0;i<=N;i++){
    scanf("%ld",&A[i]);
  }
  for(long i=0;i<=N;i++){
    C=C*A[i];
    if (C==0)
    {
      printf("0");
    }
  } 
  if(C>=1000000000000000000){
    printf("%ld",C);
  }else{
    printf("-1");
  }
  return 0;
}
  
