#include <stdio.h>
#include <stdlib.h>
#include <math.h>
 
int main()
{
  int n, i;
  scanf("%d", &n);
  unsigned long a[n];
  unsigned long tmp = pow(10, 18);
  unsigned long sum = 1;
  for (i = 0; i < n; i++)
  {
    scanf("%lu", &a[i]);
    sum = sum * a[i];
  }
  if (sum > tmp)
  {
    printf("-1\n");
    return 0;
  }
  printf("%lu", sum);
}