#include <stdio.h>

int main (void)
{
  long double x[100000],tmp;
  int i,j,y;
  long double s,sum;
  sum = 1;
  scanf("%d", &y);
  for(i = 0; i < y; i++) {
    scanf("%Lf",&x[i]);
  }

for(i=0; i<y; i++) {
  sum = sum * x[i];
if(sum > 1000000000000000000) {
  printf("-1\n");
  return 0;
}
}
  printf("%.0Lf\n",sum);
   return 0;
}
