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

#define MAX	1000000000000000000

int main(){
  char	flag=0;
  unsigned long long int	N, i, ans;
  unsigned long long int	A;
  
  scanf("%llu\n", &N);
  scanf("%llu", &A);
  ans = A;
  
  for(i=1; i<N; i++){
    scanf("%llu", &A);
    ans = ans * A;
  }
  if(ans > MAX){ printf("-1"); }
  else		   { printf("%llu", ans); }

  return 0;
}