#include <stdio.h>
#include <math.h>
#define M 1000000000000000000
int main(void) {
  int n,i;
  unsigned long a=1,b=1;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%ld",&b);
    a=a*b;
  }
  if(a>M){
    a=-1;
  }
  printf("%ld\n",a);
  return 0;
}